Truncating Empty Fields

  • Thread starter Thread starter C. Sharp
  • Start date Start date
C

C. Sharp

I have address fields: address1, address2, address3,
City, State, Postal Code

On a report, how do I make my fields truncate if there is
NO data entered in address 2 or address 3.

Example:
ABC Corporation
123 Main Street

Hometown, TN 12345

On some records Address 2 may be a suite so it needs to
be there but if address2 is blank my report looks like
the example above which leaves a blank line. How do I
make it Hometown, TN 12345 move up to address2 position?
Hope this makes sense.
 
You can set the Can Shrink property to Yes. If that doesn't work, you can
use one text box with a control source like:
=[Company] & Chr(13) +Chr(10) + [Address1] & Chr(13) + Chr(10) + [Address2]
& Chr(13) + Chr(10) + [Address3] & [City] & ", " & [State] & " " & [Zip]
 
Set the shrink property to yes for the applicable text
boxes and the report band.
Keep in mind that if you have an adjacent field and that
does not shrink at the same time than you still could end
up with a space.
Hope this helps.
Fons
 
Back
Top