mailing labels - square box at end of first line in report

  • Follow


Greetings,

I use the following expression to print mailing labels. When there is a
company name in the record, everything is fine. When there is not a company
name, I get a small square box at the end of the name on the first line. Any
thoughts on what I am missing?

This expression is in the query. "SendTo" is in the report detail section
SendTo: ([CustomerName] & Chr(13) & Chr(10) + [CompanyName] & Chr(13) & Chr
(10) & [Address] & Chr(13) & Chr(10) & [CSZ])

fields involved are all from the same table, record source is a query:
CustomerName: ([ContactFirstName] & " " & [ContactLastName]) - expresiion
form 2 text fields
CompanyName - table text field
Address - table text field
CSZ: ([City] & ", " & UCase([StateOrProvince]) & " " & [PostalCode]) -
expression from 3 text fields

Here is SQL for query:
SELECT Clients.ClientID, Clients.CompanyName, Clients.Address, Clients.City,
Clients.StateOrProvince, Clients.PostalCode, Clients.Country, Clients.
ContactLastName, Clients.ContactFirstName, Clients.ContactTitle, Clients.
PhoneNumber, Clients.FaxNumber, Clients.ReferredBy, Clients.Notes, Clients.
email, Clients.cellnumber, ([ContactFirstName] & " " & [ContactLastName]) AS
CustomerName, ([City] & ", " & UCase([StateOrProvince]) & " " & [PostalCode])
AS CSZ, ([CustomerName] & Chr(13) & Chr(10)+[CompanyName] & Chr(13) & Chr(10)
& [Address] & Chr(13) & Chr(10) & [CSZ]) AS SendTo
FROM Clients
ORDER BY Clients.ContactLastName, Clients.ContactFirstName;

Thanks,
Scott

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/200912/1

0
Reply Scott_Brasted 12/3/2009 9:11:11 PM

Try:
SendTo: ([CustomerName] & Chr(13) + Chr(10) + [CompanyName] & Chr(13) & 
Chr(10) & [Address] & Chr(13) & Chr(10) & [CSZ])

-- 
Duane Hookom
Microsoft Access MVP


"Scott_Brasted via AccessMonster.com" wrote:

> Greetings,
> 
> I use the following expression to print mailing labels. When there is a
> company name in the record, everything is fine. When there is not a company
> name, I get a small square box at the end of the name on the first line. Any
> thoughts on what I am missing?
> 
> This expression is in the query. "SendTo" is in the report detail section
> SendTo: ([CustomerName] & Chr(13) & Chr(10) + [CompanyName] & Chr(13) & Chr
> (10) & [Address] & Chr(13) & Chr(10) & [CSZ])
> 
> fields involved are all from the same table, record source is a query:
> CustomerName: ([ContactFirstName] & " " & [ContactLastName]) - expresiion
> form 2 text fields
> CompanyName - table text field
> Address - table text field
> CSZ: ([City] & ", " & UCase([StateOrProvince]) & " " & [PostalCode]) -
> expression from 3 text fields
> 
> Here is SQL for query:
> SELECT Clients.ClientID, Clients.CompanyName, Clients.Address, Clients.City,
> Clients.StateOrProvince, Clients.PostalCode, Clients.Country, Clients.
> ContactLastName, Clients.ContactFirstName, Clients.ContactTitle, Clients.
> PhoneNumber, Clients.FaxNumber, Clients.ReferredBy, Clients.Notes, Clients.
> email, Clients.cellnumber, ([ContactFirstName] & " " & [ContactLastName]) AS
> CustomerName, ([City] & ", " & UCase([StateOrProvince]) & " " & [PostalCode])
> AS CSZ, ([CustomerName] & Chr(13) & Chr(10)+[CompanyName] & Chr(13) & Chr(10)
> & [Address] & Chr(13) & Chr(10) & [CSZ]) AS SendTo
> FROM Clients
> ORDER BY Clients.ContactLastName, Clients.ContactFirstName;
> 
> Thanks,
> Scott
> 
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/200912/1
> 
> .
> 
0
Reply Utf 12/3/2009 10:07:02 PM


Duane,

Zippity do dah! Thank you. I thought it woudl be simple fiix. What does
adding a plus instead of an ampersand in this case do? Does the Chr(10) go
the CmompanyName?

Thanks,
Scott

Duane Hookom wrote:
>Try:
>SendTo: ([CustomerName] & Chr(13) + Chr(10) + [CompanyName] & Chr(13) & 
>Chr(10) & [Address] & Chr(13) & Chr(10) & [CSZ])
>
>> Greetings,
>> 
>[quoted text clipped - 29 lines]
>> Thanks,
>> Scott

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/200912/1

0
Reply Scott_Brasted 12/4/2009 3:57:05 AM

I thought you would know what the difference is between + and & since your 
initial post used them. The + will propogate a null value.

-- 
Duane Hookom
Microsoft Access MVP


"Scott_Brasted via AccessMonster.com" wrote:

> Duane,
> 
> Zippity do dah! Thank you. I thought it woudl be simple fiix. What does
> adding a plus instead of an ampersand in this case do? Does the Chr(10) go
> the CmompanyName?
> 
> Thanks,
> Scott
> 
> Duane Hookom wrote:
> >Try:
> >SendTo: ([CustomerName] & Chr(13) + Chr(10) + [CompanyName] & Chr(13) & 
> >Chr(10) & [Address] & Chr(13) & Chr(10) & [CSZ])
> >
> >> Greetings,
> >> 
> >[quoted text clipped - 29 lines]
> >> Thanks,
> >> Scott
> 
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/200912/1
> 
> .
> 
0
Reply Utf 12/4/2009 5:58:01 AM

Duane,

I'm sorry I must not have phrased my question correctly. I do know the
difference between & and +.  However,  I do not know much about chr(10) and
chr(13).  So I did not know where to put the + in regard to the chr(10) and
chr(13) for the CompanyName field.  I really appreciate your help with this.
I guess my question should have been how does the + relate to the chrs and
the field in this case.

Again thanks,
Scott

Duane Hookom wrote:
>I thought you would know what the difference is between + and & since your 
>initial post used them. The + will propogate a null value.
>
>> Duane,
>> 
>[quoted text clipped - 14 lines]
>> >> Thanks,
>> >> Scott

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/200912/1

0
Reply Scott_Brasted 12/4/2009 3:47:56 PM

Chr(13) will display a square box when used without the Chr(10). 

If CompanyName is Null then the entire expression below is Null:
     Chr(13) + Chr(10) + [CompanyName]

If CompanyName is Null then the expression below returns Chr(10) which is 
the square:
     Chr(13) & Chr(10) + [CompanyName]

-- 
Duane Hookom
Microsoft Access MVP


"Scott_Brasted via AccessMonster.com" wrote:

> Duane,
> 
> I'm sorry I must not have phrased my question correctly. I do know the
> difference between & and +.  However,  I do not know much about chr(10) and
> chr(13).  So I did not know where to put the + in regard to the chr(10) and
> chr(13) for the CompanyName field.  I really appreciate your help with this.
> I guess my question should have been how does the + relate to the chrs and
> the field in this case.
> 
> Again thanks,
> Scott
> 
> Duane Hookom wrote:
> >I thought you would know what the difference is between + and & since your 
> >initial post used them. The + will propogate a null value.
> >
> >> Duane,
> >> 
> >[quoted text clipped - 14 lines]
> >> >> Thanks,
> >> >> Scott
> 
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/200912/1
> 
> .
> 
0
Reply Utf 12/4/2009 5:05:01 PM

Actually, I believe it will return Chr(13) not Chr(10).  The precedence of the 
operators would perform the + concatenate first and then the & concatenate.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Duane Hookom wrote:
> Chr(13) will display a square box when used without the Chr(10). 
> 
> If CompanyName is Null then the entire expression below is Null:
>      Chr(13) + Chr(10) + [CompanyName]
> 
> If CompanyName is Null then the expression below returns Chr(10) which is 
> the square:
>      Chr(13) & Chr(10) + [CompanyName]
> 
0
Reply John 12/4/2009 5:38:13 PM

Of course. Thanks John.

-- 
Duane Hookom
Microsoft Access MVP


"John Spencer" wrote:

> Actually, I believe it will return Chr(13) not Chr(10).  The precedence of the 
> operators would perform the + concatenate first and then the & concatenate.
> 
> John Spencer
> Access MVP 2002-2005, 2007-2009
> The Hilltop Institute
> University of Maryland Baltimore County
> 
> Duane Hookom wrote:
> > Chr(13) will display a square box when used without the Chr(10). 
> > 
> > If CompanyName is Null then the entire expression below is Null:
> >      Chr(13) + Chr(10) + [CompanyName]
> > 
> > If CompanyName is Null then the expression below returns Chr(10) which is 
> > the square:
> >      Chr(13) & Chr(10) + [CompanyName]
> > 
> .
> 
0
Reply Utf 12/4/2009 8:36:01 PM

Thank you both. I appreciate the info. Learn every day.

Best,
Scott

Duane Hookom wrote:
>Of course. Thanks John.
>
>> Actually, I believe it will return Chr(13) not Chr(10).  The precedence of the 
>> operators would perform the + concatenate first and then the & concatenate.
>[quoted text clipped - 14 lines]
>> > 
>> .

-- 
Message posted via http://www.accessmonster.com

0
Reply Scott_Brasted 12/4/2009 9:54:23 PM

8 Replies
260 Views

(page loaded in 3.546 seconds)

Similiar Articles:
















7/31/2012 3:50:50 PM


Reply: