Addresses with blank lines due to Null records

  • Thread starter Thread starter Richard Allan Kelley
  • Start date Start date
R

Richard Allan Kelley

I have the following information in a textbox:

=[ShippingName] & Chr(13) & Chr(10) & [shippingaddress1] &
Chr(13) & Chr(10) & [shippingaddress2] & Chr(13) & Chr(10)
& [ShippingCity] & ", " & [ShippingState] & " " &
[ShippingZip] & Chr(13) & Chr(10) & [Shippingmark] & Chr
(13) & Chr(10) & [Shippingmark2] & Chr(13) & Chr(10) &
[Shippingmark3] & Chr(13) & Chr(10) & [Shippingmark4] & Chr
(13) & Chr(10) & [shippingattn]

I had the Textbox set to Shrink/Grow as suggested in other
postings. It did not work. The Null fields were blank
coming up as blank fields.

Any suggestions on removing the Null fields in VB code or
a very long expression?

Richard
 
Richard said:
I have the following information in a textbox:

=[ShippingName] & Chr(13) & Chr(10) & [shippingaddress1] &
Chr(13) & Chr(10) & [shippingaddress2] & Chr(13) & Chr(10)
& [ShippingCity] & ", " & [ShippingState] & " " &
[ShippingZip] & Chr(13) & Chr(10) & [Shippingmark] & Chr
(13) & Chr(10) & [Shippingmark2] & Chr(13) & Chr(10) &
[Shippingmark3] & Chr(13) & Chr(10) & [Shippingmark4] & Chr
(13) & Chr(10) & [shippingattn]

I had the Textbox set to Shrink/Grow as suggested in other
postings. It did not work. The Null fields were blank
coming up as blank fields.

Any suggestions on removing the Null fields in VB code or
a very long expression?

There is a "trick" when concatenating values that might be
Null. The + operator will concatenate two strings, but if
one of them is Null, it will have a result of Null.
Translating that cryptic explanation to your expression
would be something like:

=[ShippingName] & (Chr(13) + Chr(10) + [shippingaddress1]) &
(Chr(13) + Chr(10) + [shippingaddress2]) & Chr(13) & Chr(10)
& [ShippingCity] & ", " & [ShippingState] & " " &
[ShippingZip] & (Chr(13) + Chr(10) + [Shippingmark]) &
(Chr(13) + Chr(10) + [Shippingmark2]) & (Chr(13) + Chr(10) +
[Shippingmark3]) & (Chr(13) + Chr(10) + [Shippingmark4]) &
(Chr(13) + Chr(10) + [shippingattn])
 
Back
Top