Line feed characters

Steven McEwan

New member
Local time
Today, 07:55
Joined
Oct 14, 2001
Messages
8
I would like to display a postal address in each record in a report. The address is made up of five fields, some of which are sometimes blank.

I am using a text box as follows:

=[Schedule].[Address_1] & " " & [Schedule].[Address_2] & " " & ...

I would like to insert line feed characters in the text box (in place of the spaces) so that each non-null field in the text box appears on a separate line, (and so that null fields do not appear - but I can do this part with the IIf(IsNull()) function) .

I have tried Chr(10) and Chr(13) but these just produce square characters on the screen and spaces when printed.

Any help gratefully received.
 
Thanks for replying, Scott. Unfortunately I cannot get this to work, as I am asked to specify the value of the parameter VbCrLf.

To be clear, I have updated my text box as follows:

= [Address_1] & VbCrLf & [Address_2] & VbCrLf & ...

Perhaps I am using your suggestion wrongly, in which case I would be grateful for direction.

Thanks.
 
Visual Basic constants can only be used... within a VB module. Try = [Address_1] & chr(13) & chr(10) & [Address_2] & chr(13) & chr(10) & ...

instead

Alex
 
Many thanks for your reply. I see now that my error was to fail to use Chr(13) and Chr(10) in combination, rather than separately.

I appreciate the help from both of you.
 

Users who are viewing this thread

Back
Top Bottom