Line Breaks in forms and reports

GregP

Registered User.
Local time
Today, 22:58
Joined
Sep 16, 2002
Messages
66
Hi,

I've got a composite field in my report containing several fields from the query, but I want to be able to insert a carriage return and a line break (<crlf> in the example below). It's for an invoice, and in the database I have a field for address (i.e. street name and number), another field for suburb, another for state and another for postcode. I'm wanting to display the entire delivery address in the format you normally would, i.e.:

1 Smith St,<crlf>
Heresville<crlf>
State 12345

I've tried the following in the control source of the field with no success:

=[Address1] + <shift return>
+ [Suburb1]
(displays in form and in control source as a single line of text)

=[Address1] + Chr(13) + [Suburb1]
=[Address1] + Chr(10) + [Suburb1]
(both display an outline box instead of the relevent control character)
=[Address1] + _ + [Suburb1]
=[Address1] _ [Suburb1]
(both of these are reverted to + " " + )

All I get is erroneous variations of 1 Smith St Heresville, but definately with no line break between the address and the suburb.

What am I doing wrong? Surely there has to be a way to do this?

Thanks in anticipation for your help!
 
Last edited:
That *should* work, but all I get is the address, then two boxes, and then the suburb. Using Access2k. It doesn't seem to understand control characters. Is there some extra control character handler which has to be installed or something?
 
Oops wrong way around
=[Address1]&Chr(13) & Chr(10) & [Suburb1] or in VBA
Me.Some field = [Address1] & vbCrLf & [Suburb1]
 
True legend, thanks! :D

Do you happen to have a listing of all the control characters? For future reference.
 
:mad:
Why in the world doesn't this work for me?
I've got it exactly the same, but Access keeps telling me that "The function you used can't be used in this expression. It does not allow me to put any Chr() keywords in the control source.
 
Got it.

Turns out that it was a problem with my References. They were all there (none marked MISSING), but I just had to reset them. This thread helped me out. :D
 

Users who are viewing this thread

Back
Top Bottom