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

Address Formula

Status
Not open for further replies.

rafeman

Technical User
Oct 20, 2004
66
GB
Hi there,

I have an table called SL_ADDRESSES that stores the the address like so;

Field: AD_Address - this holds all the address lines to the town. It has a carriage return sysmbol (square) between each return.

Field: AD_ADDRESS_USER1 - this is the town

Field: AD_ADDRESS_USER2 - this is the county

Field: AD_POSTCODE - this is the postcode.

The problem is the report cuts off the postcode and county etc. if the main address line (AD_Address) has more than 2 carriage returns. The formula used at the moment is below.

whileprintingrecords;

Stringvar Invoice_Address;

Invoice_Address := "";

If not IsNull({SL_ACCOUNTS.CUNAME}) and ({SL_ADDRESSES.AD_ACCOUNTNAME})=0 then //AD_ACCOUNTNAME is TRUE if Exclude Account Name on addresses is selected
Invoice_Address:={SL_ACCOUNTS.CUNAME}+chr(13);

If not IsNull({SL_ADDRESSES.AD_ADDRESS}) then
Invoice_Address:=Invoice_Address+TrimRight({SL_ADDRESSES.AD_ADDRESS})+chr(13);

If not IsNull({SL_ADDRESSES.AD_ADDRESS_USER1}) and Length({SL_ADDRESSES.AD_ADDRESS_USER1})>0 then
Invoice_Address:=Invoice_Address+{SL_ADDRESSES.AD_ADDRESS_USER1}+chr(13);

If not IsNull({SL_ADDRESSES.AD_ADDRESS_USER2}) and Length({SL_ADDRESSES.AD_ADDRESS_USER2})>0 then
Invoice_Address:=Invoice_Address+{SL_ADDRESSES.AD_ADDRESS_USER2}+chr(13);

If not IsNull({SL_ADDRESSES.AD_POSTCODE}) then
Invoice_Address:= Invoice_Address+{SL_ADDRESSES.AD_POSTCODE};

Invoice_Address;


Can you help.

Thanks
 
Do you have "Can Grow" set on the field? They may be there, but you just can't see them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top