Carriage Returns in Exprssion Builder...Again

G

Guest

Hi.

I am really trying...but I cannot get a carriage return in
Expression Builder. I got the reply from "SA"
<[email protected]> 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] &

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
 
R

Roger Carlson

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.
 
G

Guest

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

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]
 
M

Marshall Barton

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

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][/QUOTE]


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]
 

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