new line in memofield

J

Jean-Paul

Hi,

I have a memofield on a form where I want to but some text in when
clicking on a checkbox.

First line: Electical
Second line: nothing
Third line: Mechanical

Now I write:

Me!Remarks = "Electrical"

Then I should add 2 Ctrl-enter commands and the add "Mechanical"

Any suggestions?
Thanks
 
J

Jeanette Cunningham

Hi Jean-Paul,

try it like this, using vbNewLine to create a new line.

Me!Remarks = "Electrical" & vbNewLine _
& vbNewLine & "Mechanical"


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
J

Jean-Paul

Great... just what I needed
Hope I get an as usefull answer to my other questions as this one!!!!

JP, Belgium
 
M

Marshall Barton

Jean-Paul said:
I have a memofield on a form where I want to but some text in when
clicking on a checkbox.

First line: Electical
Second line: nothing
Third line: Mechanical

Now I write:

Me!Remarks = "Electrical"

Then I should add 2 Ctrl-enter commands and the add "Mechanical"


The VBA Editor does not recognize that.

do it one of these ways:

Me!Remarks = "Electrical" & vbNewLine & vbNewline &
"Mechanical"
or
Me!Remarks = "Electrical" & vbCrLf & vbCrLf & "Mechanical"
or
Me!Remarks = "Electrical" & Chr(13 & Chr(10) & Chr(13 &
Chr(10) & "Mechanical"
 

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