Hlp Pls

T

terryh70

I am using the following code in a unbound text box on a report.

How do I get blank lines to disappear if the result is null. As it is right
now it pulls what i need but the report will not shrink, it is always 5
lines. If record one is not diplayed record two is lways on line two instead
of shrinking to line one and so forth.

=IIf([SUBJECTUNITADDRESS1] Like "*" & "1-26" &
"*",[SUBJECTUNITADDRESS1],"")+(Chr(13) & Chr(10))+IIf([SUBJECTUNITADDRESS2]
Like "*" & "1-26" & "*",[SUBJECTUNITADDRESS2],"")+(Chr(13) &
Chr(10))+IIf([SUBJECTUNITADDRESS3] Like "*" & "1-26" &
"*",[SUBJECTUNITADDRESS3],"")+(Chr(13) & Chr(10))+IIf([SUBJECTUNITADDRESS4]
Like "*" & "1-26" & "*",[SUBJECTUNITADDRESS4],"")+(Chr(13) &
Chr(10))+IIf([SUBJECTUNITADDRESS5] Like "*" & "1-26" &
"*",[SUBJECTUNITADDRESS5],"")
 
J

Jeff Boyce

One approach might be to put the Chr(10) & Chr(13) inside the IIF() instead
of outside. Your statement forces a crlf after each IIF() statement.

Another approach might be to use individual controls to hold the separate
fields, and set the CanGrow and CanShrink properties.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top