using code to add a line break in a memo field

  • Thread starter Thread starter McLean J
  • Start date Start date
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.
 
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]
 
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.


.
 
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.
 
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
 
Back
Top