PDA

Click to See Complete Forum and Search --> : Crystal Report?


blakemckenna
Feb 17th, 2006, 04:58 PM
Hi,

I didn't know where else to post this question so I thought I'd try here. I have a formula that is giving me an error that I don't know how to resolve. Here is my code


If Length ({tblVendor.venAddr2}) > 0 Then
Trim ({tblVendor.venAddr2})
Trim ({tblVendor.venCity}+", "+{tblVendor.venState}+" "+{tblVendor.venZipCode})
Else
Trim ({tblVendor.venCity}+", "+{tblVendor.venState}+" "+{tblVendor.venZipCode})


The error message is:

"The remaining text does not appear to be part of the forumula"

It bombs at the beginning of the 2nd Trim statement in the If branch. I tried using the continuation character "_" and the end of the Then and also using an End If statement and neither of those worked.

Anyone have any ideas?

Thanks,

Blake

GaryMazzone
Feb 17th, 2006, 06:57 PM
The problem is in the line:
Trim ({tblVendor.venAddr2})
Trim ({tblVendor.venCity}+", "+{tblVendor.venState}+" "+{tblVendor.venZipCode})

It should be:
Trim ({tblVendor.venAddr2}) + " " +
Trim ({tblVendor.venCity}+", "+{tblVendor.venState}+" "+{tblVendor.venZipCode})


You are missing a plus sign (+) after venAddr2 and before venCity

blakemckenna
Feb 17th, 2006, 09:33 PM
Gary,

If I use that method...both lines end up coming out as 1 line and I want 2 separate address lines.

RobDog888
Feb 17th, 2006, 10:28 PM
Moved from Classic VB :)

Tribo
Feb 19th, 2006, 09:08 PM
If you want 2 separate address lines you could try using chr(13)

Regards,
Tribo

GaryMazzone
Feb 21st, 2006, 08:05 AM
I wrote that the way you had it only. I do the same thing in my reports also but Name the functions Line 3 and line 4. If the second address line is empty the line line 3 becomes the city,state and zip and line 4 is empty. If the second address line is not empty then line 3 is the second address line and line 4 is city state and zip. Both funcitons are placed on the report.