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  

Carriage Returns in Exprssion Builder...Again



 
 
Thread Tools Display Modes
  #1  
Old May 27th, 2004, 12:06 PM
external usenet poster
 
Posts: n/a
Default Carriage Returns in Exprssion Builder...Again

Hi.

I am really trying...but I cannot get a carriage return in
Expression Builder. I got the reply from "SA"
on this subject and he/she said
the following:

Use either vbcrlf or Chr(10) & Chr(13)

I tried, but I must not know the proper way to insert this
in Expression Builder.

What I want to do is have an Access report give me a
phone/address directory. I have type in the following:

=[First Name] & " " & [Last Name] & [Address] & [City]
& ", " & [State] & " " [Zip] & [Phone] & [email]

I get all of the information that I want to appear on the
report. But it is all on one line. Now, I could do
separate text boxes, but then I would have all of these
blank lines for those who do not have an email address or
a phone number, or even an address.

So, what is the simple solution (or is there a simple one)
to create a carriage return in Expression Builder?

Thanks again and have a GREAT WEEKEND!!!

Joe

  #2  
Old May 27th, 2004, 12:42 PM
Roger Carlson
external usenet poster
 
Posts: n/a
Default Carriage Returns in Exprssion Builder...Again

The thing to do is use separate text boxes. Access has feature that allows
you to overcome the problem with the extra blank spaces in reports. It is
called the "CanShrink" property. If there is no data for a field, the text
box will shrink to zero height.

Try creating a Label report with the Label Wizard and then take a look at
the properties of the fields.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org


wrote in message
...
Hi.

I am really trying...but I cannot get a carriage return in
Expression Builder. I got the reply from "SA"
on this subject and he/she said
the following:

Use either vbcrlf or Chr(10) & Chr(13)

I tried, but I must not know the proper way to insert this
in Expression Builder.

What I want to do is have an Access report give me a
phone/address directory. I have type in the following:

=[First Name] & " " & [Last Name] & [Address] & [City]
& ", " & [State] & " " [Zip] & [Phone] & [email]

I get all of the information that I want to appear on the
report. But it is all on one line. Now, I could do
separate text boxes, but then I would have all of these
blank lines for those who do not have an email address or
a phone number, or even an address.

So, what is the simple solution (or is there a simple one)
to create a carriage return in Expression Builder?

Thanks again and have a GREAT WEEKEND!!!

Joe



  #3  
Old May 27th, 2004, 01:59 PM
external usenet poster
 
Posts: n/a
Default Carriage Returns in Exprssion Builder...Again

=[First Name] & " " & [Last Name] & vbCrLf & [Address] &
[City] & " " & [State] & " " [Zip] & vbCrLf & [Phone] &
vbCrLf & [email]

If this does not work in the expression builder, leave
the textbox unbound and use the following code in the
report open event:

TextboxName = [First Name] & " " & [Last Name] & vbCrLf &
[Address] & [City] & " " & [State] & " " [Zip] & vbCrLf &
[Phone] & vbCrLf & [email]


-----Original Message-----
Hi.

I am really trying...but I cannot get a carriage return

in
Expression Builder. I got the reply from "SA"
on this subject and he/she said
the following:

Use either vbcrlf or Chr(10) & Chr(13)

I tried, but I must not know the proper way to insert

this
in Expression Builder.

What I want to do is have an Access report give me a
phone/address directory. I have type in the following:

=[First Name] & " " & [Last Name] & [Address] & [City]
& ", " & [State] & " " [Zip] & [Phone] & [email]

I get all of the information that I want to appear on

the
report. But it is all on one line. Now, I could do
separate text boxes, but then I would have all of these
blank lines for those who do not have an email address

or
a phone number, or even an address.

So, what is the simple solution (or is there a simple

one)
to create a carriage return in Expression Builder?

Thanks again and have a GREAT WEEKEND!!!

Joe

.

  #4  
Old May 27th, 2004, 02:40 PM
Marshall Barton
external usenet poster
 
Posts: n/a
Default Carriage Returns in Exprssion Builder...Again

wrote:

=[First Name] & " " & [Last Name] & vbCrLf & [Address] &

[City] & " " & [State] & " " [Zip] & vbCrLf & [Phone] &
vbCrLf & [email]

If this does not work in the expression builder, leave
the textbox unbound and use the following code in the
report open event:

TextboxName = [First Name] & " " & [Last Name] & vbCrLf &
[Address] & [City] & " " & [State] & " " [Zip] & vbCrLf &
[Phone] & vbCrLf & [email]



The problem you have with the above is that vbCrLf is a VBA
defined constant that is not in the name space of control
source or SQL expressions.

You can use Chr(13) & Chr(10) instead, BUT be certain that
you use them in that order, they can not be in the reverse
order.

=[First Name] & " " & [Last Name] & Chr(13) & Chr(10) &
[Address] & Chr(13) & Chr(10) & [City] & ", " & [State] & "
" [Zip] &Chr(13) & Chr(10) & [Phone] & Chr(13) & Chr(10) &
[email]
--
Marsh
MVP [MS Access]
 




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 10:42 AM.


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