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
|
|||
|
|||
adding a Carriage Return or Line Feed character to an update query
I'm building an update query that will concatenate two fields and update the
first field with the combination of the two fields. However, I would like to separate the two components with a blank line, or two carriage return or line feed characters. In Visual Basic, I'd use vbcr&vbcr to do this. How can I do this in an update query? Thanks in advance, Paul |
#2
|
|||
|
|||
adding a Carriage Return or Line Feed character to an update query
Paul wrote:
I'm building an update query that will concatenate two fields and update the first field with the combination of the two fields. However, I would like to separate the two components with a blank line, or two carriage return or line feed characters. In Visual Basic, I'd use vbcr&vbcr to do this. How can I do this in an update query? In Access you should use vbCrLf, vbNewLine or Chr(13) & Chr(10), where the latter sequence will work anywhere and the two predefined constants pn work in a VBA procedure. Your query would be something like: UPDATE thetable SET fld1 = fld1 & Chr(13) & Chr(10) & Chr(13) & Chr(10) & fld2 -- Marsh MVP [MS Access] |
#3
|
|||
|
|||
adding a Carriage Return or Line Feed character to an update query
Chr(13) & Chr(10)
-- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Paul" wrote in message ... I'm building an update query that will concatenate two fields and update the first field with the combination of the two fields. However, I would like to separate the two components with a blank line, or two carriage return or line feed characters. In Visual Basic, I'd use vbcr&vbcr to do this. How can I do this in an update query? Thanks in advance, Paul |
#4
|
|||
|
|||
adding a Carriage Return or Line Feed character to an update query
Chr(13) & Chr(10) work great.
My thanks to Marsh and Allen. I used the expression SET fld1 = fld1 & Chr(13) & Chr(10) & Chr(13) & Chr(10) & fld2 and it put a blank line in between the two concatenated fields, which is exactly what I was trying to accomplish. Paul |
Thread Tools | |
Display Modes | |
|
|