using code to add a line break in a memo field

M

McLean J

I want a button to add text to my memo field "before" any
existing memo text. But I need a "line break" between
what I add and the original info.

I have this but the Chr(10) didn't work...

[memNotes] = "Amended on " & Date & Chr(10) & [memNotes]

Please help.
 
K

Ken Snell

ACCESS uses the combination of the carriage return and the line feed
characters (in that order!) for a line break. Try this:

[memNotes] = "Amended on " & Date & Chr(13) & Chr(10) & [memNotes]
 
G

Guest

worked great, thanks.
-----Original Message-----
ACCESS uses the combination of the carriage return and the line feed
characters (in that order!) for a line break. Try this:

[memNotes] = "Amended on " & Date & Chr(13) & Chr(10) & [memNotes]

--
Ken Snell
<MS ACCESS MVP>

I want a button to add text to my memo field "before" any
existing memo text. But I need a "line break" between
what I add and the original info.

I have this but the Chr(10) didn't work...

[memNotes] = "Amended on " & Date & Chr(10) & [memNotes]

Please help.


.
 
M

Microsoft News Groups

You can also use the VBA constant vbCrLf in place of Chr(13) & Chr(10).
This is identical and takes less typing and could be considered better in
terms of self-documentation.

Rod Scoullar.
 
T

Tim Ferguson

You can also use the VBA constant vbCrLf in place of Chr(13) & Chr(10).
This is identical and takes less typing and could be considered better in
terms of self-documentation.

vbNewLine takes more typing but is guaranteed to return the correct EOL
sequence for the OS in question. With VBA now being released for the Mac,
perhaps it's time for us all to get on board with cross-platform
stability...


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top