Comment Fields

P

PeterM

I am using Access 2003. I have a comment field in a
table. Using VBA code I need to add a CRLF to the
comment field. I tried using CHR(13) which is what I use
to add a CRLF to a message in a MSGBOX, but that displays
a "|" in the comment field. How do I insert a CRLF
within a comment field.


comment_txt = ????? + comment_txt
 
F

fredg

I am using Access 2003. I have a comment field in a
table. Using VBA code I need to add a CRLF to the
comment field. I tried using CHR(13) which is what I use
to add a CRLF to a message in a MSGBOX, but that displays
a "|" in the comment field. How do I insert a CRLF
within a comment field.

comment_txt = ????? + comment_txt

You have a choice.
In Access you must use chr(13) & chr(10) (together, in that order).

=[FieldName] & chr(13) & chr(10) & "Add additional comments."

In VBA you can use the above or vbNewLine or vbCrLf

=[FieldName] & vbNewLine & "Add additional comments."
or...
=[FieldName] & vbCrLf & "Add additional comments."
 
Top