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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|