May 28, 2009 at 12:22 pm
I am making a report to be able to print labels. The labels are coming out great and are lined up correctly! The problem I'm having is that I have a 2nd address line that is only populated for 10 out of 1000 labels. They want me to be able to move up the city/state/zip under the first addr. line as if Addr2 didn't exsist. Can I do this?
Code
Name
Addr1
Addr2
City/State/Zip
May 28, 2009 at 1:19 pm
I take it each label is a repetition of some sort of list or some other type of container control...
The easiest albeit somewhat harder to manage down the road would be to just put everything into 1 textbox.
=Code & vbcrlf & _
Name & vbcrlf & _
Addr1 & vbcrlf & _
Addr2 & vbcrlf & _
City/State/Zip
Then you just need to modify it to test for addr2=Nothing using IIF on whether or not to include that line.
Or you could look into changing the visibility of the addr2 control based on addr2=Nothing but I'm not sure that would work. You could try it though and let us know how you make out.
-Luke.
May 28, 2009 at 1:22 pm
I've tried hiding Addr2 and I 'think' that I'm doing it right and still not getting the results that I'm looking for.
For the hidden expression I have: fields!Addr2.Value is nothing
Perhaps that's where my problem is?
May 28, 2009 at 1:27 pm
May 28, 2009 at 1:46 pm
I had that originally. But then I read somewhere, I believe on here, that the hidden property always takes the last option in the if statement...
so in this case...
=IIF(fields!Addr2.Value is nothing,True,False)
it would always return false.
??
May 28, 2009 at 2:02 pm
ummm... no.
I use that logic quite frequently and it works for me. You just have to realize what you are passing. it might be helpful for you to temporarily put your IIF statement into a test textbox (or perhaps even into the addr2 section) that way you could verify the output and place the True and false accordingly.
I suppose it also may have something to do with what you actually receive as a blank record. Do you get NULL, a zero length string '', or a padded string ' '? All Nothings are not the same.
You could also play around with the IsNothing function You could try it with either of the following
= IsNothing(fields!Addr2.Value)
or
= NOT IsNothing(fields!Addr2.Value)
depending on what you need.
May 28, 2009 at 2:03 pm
just to show you where I got that information from...
http://www.sqlservercentral.com/Forums/FindPost468368.aspx
I've gone ahead and put everything into one expression and things are exactly how I want them. Thanks for the help!
LSM
May 28, 2009 at 2:12 pm
Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply