Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Insert Line Break in formula

Status
Not open for further replies.

byrne1

Programmer
Aug 7, 2001
415
US
I have a formula that places the mailing address on a report as follows:

LeadingCaps({address1})

What I want is to check the value of address 2 and, if data is there, to print addr1, insert a line break, and then print addr2. I would ASSUME that the formula would look something like this (I know this doesn't work):

If {address2}="" then
LeadingCaps({address1})
else
LeadingCaps({address1}) + linebreak + LeadingCaps({address2})


The question is what function will insert the line break?
 
Change the formula to use the chr function for the linebreak:

If {address2}="" then
LeadingCaps({address1})
else
LeadingCaps({address1}) + chr(13) + LeadingCaps({address2})

~Brian
 
I forgot to add that you would also need to either set the field to height of 2 lines, or right click it, choose format field, and under the common tab set the can grow property.

~Brian
 
Have you tried inserting the address fields in a text box and then right-clicking and selecting remove blanks lines?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top