A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old December 3rd, 2009, 09:11 PM posted to microsoft.public.access.reports
Scott_Brasted via AccessMonster.com
external usenet poster
 
Posts: 49
Default mailing labels - square box at end of first line in report

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/For...ports/200912/1

  #2  
Old December 3rd, 2009, 10:07 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default mailing labels - square box at end of first line in report

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/For...ports/200912/1

.

  #3  
Old December 4th, 2009, 03:57 AM posted to microsoft.public.access.reports
Scott_Brasted via AccessMonster.com
external usenet poster
 
Posts: 49
Default mailing labels - square box at end of first line in report

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/For...ports/200912/1

  #4  
Old December 4th, 2009, 05:58 AM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default mailing labels - square box at end of first line in report

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/For...ports/200912/1

.

  #5  
Old December 4th, 2009, 03:47 PM posted to microsoft.public.access.reports
Scott_Brasted via AccessMonster.com
external usenet poster
 
Posts: 49
Default mailing labels - square box at end of first line in report

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/For...ports/200912/1

  #6  
Old December 4th, 2009, 05:05 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default mailing labels - square box at end of first line in report

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 squa
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/For...ports/200912/1

.

  #7  
Old December 4th, 2009, 05:38 PM posted to microsoft.public.access.reports
John Spencer
external usenet poster
 
Posts: 7,815
Default mailing labels - square box at end of first line in report

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 squa
Chr(13) & Chr(10) + [CompanyName]

  #8  
Old December 4th, 2009, 08:36 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default mailing labels - square box at end of first line in report

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 squa
Chr(13) & Chr(10) + [CompanyName]

.

  #9  
Old December 4th, 2009, 09:54 PM posted to microsoft.public.access.reports
Scott_Brasted via AccessMonster.com
external usenet poster
 
Posts: 49
Default mailing labels - square box at end of first line in report

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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.