omitting carriage returns in mailing labels

M

Marilyn

Hi,

I'm trying to modify a label report created by Access
label wizard so that when there is no company name in a
record, it won't print a blank line. I tried using the
code recommended in the online access help section, but
it didn't work. Thinks there's too many ) marks?

Here's the code:
=IIf(IsNull([FirstName1]),"",[FirstName1] & " ") & _
IIf(IsNull([LastName1]),"",[LastName1]& Chr(13)& Chr(10))
& _
IIf(IsNull([FirstName2),"",[FirstName2] & " ") & _
IIf(IsNull([LastName2]),"",[LastName2]& Chr(13)& Chr(10))
& _
IIf(IsNull([ADDRESS]),"",[ADDRESS] & Chr& Chr(10)) & _
IIf(IsNull([CITY]),"",[CITY] & ", ") & _
IIf(IsNull([REGION]) ,"",[REGION] & " ") & _
IIf(IsNull([PostalCode]),"",[PostalCode])

any ideas on what could be wrong?
-Marilyn
 
S

Steve Schapel

Marilyn,

Marilyn,

I can't see anything about Company Name in your expression at all!

I notice there is a (13) missing in the [ADDRESS] section of the expression.

I would try it like this...
=[FirstName1]+" " & [LastName1]+Chr(13)+Chr(10) & [FirstName2)+" " &
[LastName2]+Chr(13)+Chr(10) & [ADDRESS]+Chr(13)+Chr(10) & [CITY])+", " &
[REGION] & " "+[PostalCode]
 
G

Guest

Thanks Steve, got it working but there is a typo in your
code. The end parentheses after [FirstName2) should be an
end bracket.


-----Original Message-----
Marilyn,

Marilyn,

I can't see anything about Company Name in your expression at all!

I notice there is a (13) missing in the [ADDRESS] section of the expression.

I would try it like this...
=[FirstName1]+" " & [LastName1]+Chr(13)+Chr(10) & [FirstName2)+" " &
[LastName2]+Chr(13)+Chr(10) & [ADDRESS]+Chr(13)+Chr(10) & [CITY])+", " &
[REGION] & " "+[PostalCode]

--
Steve Schapel, Microsoft Access MVP

Hi,

I'm trying to modify a label report created by Access
label wizard so that when there is no company name in a
record, it won't print a blank line. I tried using the
code recommended in the online access help section, but
it didn't work. Thinks there's too many ) marks?

Here's the code:
=IIf(IsNull([FirstName1]),"",[FirstName1] & " ") & _
IIf(IsNull([LastName1]),"",[LastName1]& Chr(13)& Chr (10))
& _
IIf(IsNull([FirstName2),"",[FirstName2] & " ") & _
IIf(IsNull([LastName2]),"",[LastName2]& Chr(13)& Chr (10))
& _
IIf(IsNull([ADDRESS]),"",[ADDRESS] & Chr& Chr(10)) & _
IIf(IsNull([CITY]),"",[CITY] & ", ") & _
IIf(IsNull([REGION]) ,"",[REGION] & " ") & _
IIf(IsNull([PostalCode]),"",[PostalCode])

any ideas on what could be wrong?
-Marilyn
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top