MAS 90 4.5, Crystal Designer XI - attempting to create a formula for customer address from the AR_Customer table. Formula will not print if Address2 or Address3 are blank. If I remove Address2 and Address3 from the formula, it prints. Using the following formula under Basic syntax:
-----------------------------------
Dim CustomerName as string
Dim Address1 as string
Dim Address2 as string
Dim Address3 as string
Dim City as string
Dim State as string
Dim ZipCode as string
if {AR_Customer.CustomerName} <> """" then CustomerName = {AR_Customer.CustomerName} _
+ chr(13) + chr(10)
if {AR_Customer.AddressLine1} <> """" then Address1 = {AR_Customer.AddressLine1} _
+ chr(13)+ chr(10)
if {AR_Customer.AddressLine2} <> """" then Address2 = {AR_Customer.AddressLine2} _
+ chr(13)+ chr(10)
if {AR_Customer.AddressLine3} <> """" then Address3 = {AR_Customer.AddressLine3} _
+ chr(13)+ chr(10)
if {AR_Customer.City} <> """" then City = {AR_Customer.City} + "", ""
if {AR_Customer.State} <> """" then State = {AR_Customer.State} + "" ""
if {AR_Customer.ZipCode} <> """" then ZipCode = {AR_Customer.ZipCode}
formula = CustomerName + Address1 + Address2 + Address3 + City + State + ZipCode
------------------------------------
If I place a value in Address2 and Address3 in Customer Maintenance, the formula prints. If any address line is blank, the formula remains blank.
What am I missing? There are no link issues - only one table used in report. This should be simple.