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
|
|||
|
|||
Combine / Concatenate text and include a carraige return
In my Access report I would like the fields: address, town, county, postcode
to be combined but put on separate lines. I don't want to use separate unbound boxes for them as sometimes address is a different number of lines or town or county is blank and I don't want blank lines. Is there a syntax for carriage return so I can use something like [address] & CR & [town] & CR & [county] & " " & [postcoe] where CR is the carriage return symbol. I've trawled help but can't find it. |
#2
|
|||
|
|||
Combine / Concatenate text and include a carraige return
ruperthouse wrote:
In my Access report I would like the fields: address, town, county, postcode to be combined but put on separate lines. I don't want to use separate unbound boxes for them as sometimes address is a different number of lines or town or county is blank and I don't want blank lines. Is there a syntax for carriage return so I can use something like [address] & CR & [town] & CR & [county] & " " & [postcoe] where CR is the carriage return symbol. I've trawled help but can't find it. instead of CR use vbCrLf. So your unbound textbox's control source would be [address] & vbCrLf & [town] & ", " & vbCrLf & [county] & " " & [postcode] -- Message posted via http://www.accessmonster.com |
#3
|
|||
|
|||
Combine / Concatenate text and include a carraige return
On Wed, 24 Mar 2010 13:17:01 -0700, ruperthouse wrote:
In my Access report I would like the fields: address, town, county, postcode to be combined but put on separate lines. I don't want to use separate unbound boxes for them as sometimes address is a different number of lines or town or county is blank and I don't want blank lines. Is there a syntax for carriage return so I can use something like [address] & CR & [town] & CR & [county] & " " & [postcoe] where CR is the carriage return symbol. I've trawled help but can't find it. In Access the chr(13) & chr(10) combination (in that order) will give you a carriage return and line space. In the control source of an unbound control, write: = [address] & chr(13) & chr(10) & [town] & chr(13) & chr(10) & [county] & " " & [postcoe] In VBA you can use the above chr(13) & chr(10) combination or the VBA contstants: vbCrLf or vbNewLine =[address] & vbNewLine & [town] etc.... -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#4
|
|||
|
|||
Combine / Concatenate text and include a carraige return
You can't use vb constants in a control source or query expression. You can use
=[Field A] & chr(13) & chr(10) & [Field B] & Chr(13) & Chr(10) & [Field C] -- Duane Hookom Microsoft Access MVP "PieterLinden via AccessMonster.com" wrote: ruperthouse wrote: In my Access report I would like the fields: address, town, county, postcode to be combined but put on separate lines. I don't want to use separate unbound boxes for them as sometimes address is a different number of lines or town or county is blank and I don't want blank lines. Is there a syntax for carriage return so I can use something like [address] & CR & [town] & CR & [county] & " " & [postcoe] where CR is the carriage return symbol. I've trawled help but can't find it. instead of CR use vbCrLf. So your unbound textbox's control source would be [address] & vbCrLf & [town] & ", " & vbCrLf & [county] & " " & [postcode] -- Message posted via http://www.accessmonster.com . |
Thread Tools | |
Display Modes | |
|
|