From: Paul on
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


From: Marshall Barton on
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]
From: Allen Browne on
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" <BegoneSpam(a)forever.com> wrote in message
news:e7USUv5#KHA.4316(a)TK2MSFTNGP04.phx.gbl...
> 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
>
From: Paul on
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