enter text with a command button

J

Jim

I have a memo field whose properties are set to enter a new line on enter. I would like to put a button near the memo box on a form that would add a standard string of text and go to the next line every time the button is clicked. Any suggestions?
 
R

Rick Brandt

Jim said:
I have a memo field whose properties are set to enter a new line on
enter. I would like to put a button near the memo box on a form that would
add a standard string of text and go to the next line every time the button
is clicked. Any suggestions?

Me!MemoTextBox = Me!MemoTextBox & vbCrLf & "Some string"
 
J

JSand42737

=?Utf-8?B?Smlt?= said:
I have a memo field whose properties are set to enter a new line on enter. I
would like to put a button near the memo box on a form that would add a
standard string of text and go to the next line every time the button is
clicked. Any suggestions?

You can use some code like this:

Private Sub Command2_Click()
Me!txtNotes = Me!txtNotes & "This is the standard text." & vbCrLf
Me!txtNotes.SetFocus
Me!txtNotes.SelStart = Len(Me!txtNotes)
End Sub
 

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