Forcing A New Line In Memo Field

S

scott

I have a memo-type textbox control on a form. On the form's OnOpen event,
I'm trying insert a few lines of text.

I'm having trouble forcing a new line after the 1st line is inserted. Is
there maybe an ASCII code that I could use inplace of the "vbCrlf", which is
not forcing a new line?

With my current code below, Access is only inserting the 1st line and
chopping off my 2nd line of text. I can manually force a new line when
typing by hitting Control Key + Enter, but so far, i've had no success doing
it with VBA.


CODE ***********************

Me.myMemoField= "1st Line: Text on line 1" & vbCrLf & _
"2nd Line: Text on line 2"
 
T

TonyT

Scott, that line of code works perfectly for me on A2k, what version are you
using, have you tried vbnewline instead to try that?

TonyT..
 
M

Marshall Barton

scott said:
I have a memo-type textbox control on a form. On the form's OnOpen event,
I'm trying insert a few lines of text.

I'm having trouble forcing a new line after the 1st line is inserted. Is
there maybe an ASCII code that I could use inplace of the "vbCrlf", which is
not forcing a new line?

With my current code below, Access is only inserting the 1st line and
chopping off my 2nd line of text. I can manually force a new line when
typing by hitting Control Key + Enter, but so far, i've had no success doing
it with VBA.


CODE ***********************

Me.myMemoField= "1st Line: Text on line 1" & vbCrLf & _
"2nd Line: Text on line 2"


Looks good to me. Is the text box tall enough to display
the second line?
 

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