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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I enter a "return" line in a text string?

Status
Not open for further replies.

Monkey820

Technical User
Dec 11, 2003
62
0
0
US
I am trying to arrange fields in a formula:

if {table.FOB} = "COLLECT" then {@shipto}

I need the {@shipto} formula to list the {table.ATTN}, {table.ADD1}, {table.ADD2}, etc. in a properly lined order such as:

Attn:
Company
Address1
Address2
City, State Zipcode

TIA for any suggestions!

Micky
CRW 8.5
 
Use chr(13). So {@shipto} would look like:

{table.Company}+chr(13)+(if isnull({table.Address1}) then "" else {table.Address1}+chr(13))+(if isnull({table.Address2}) then "" else {table.Address2} + chr(13))+
{table.City}+", "+{table.State}+" "+{table.Zipcode}

You could also eliminate the formula, and place each line in a separate detail section with each detail section formatted to "suppress blank section" in the section expert. You would also then add a conditional formula in the suppress area of the section expert:

{table.FOB} <> "COLLECT"

Or, you could eliminate all rows that don't meet this criterion by using a record selection formula of:

{table.FOB} = "COLLECT"

-LB

 
As LB suggests, right click the details and select insert a section 3 additional times.

In the uppermost details (Details A), place
Attn:
{table.Company}

In the subsequent sections place the respective fields.

Right click each details section and in the X2 next to the suppress place:

{table.FOB} <> "COLLECT"

And check the suppress blank section.

The suppress blank section won't work for the city state zip line if you use a comma as it will always have a comma, so if you want to eliminate the city state zip line you'll need to check for blanks by using the formula in X2 next to Suppress, as in:

trim(({table.City}+{table.State}+{table.Zipcode})) = ""

-k
 
Absolutely perfect!

Thank you so much!

I love this site!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top