Code to insert a new line into a text box on a form.

Essendon

Registered User.
Local time
Today, 18:16
Joined
Oct 25, 2001
Messages
65
Hi,

I have a text box on the screen, whose text is then taken as a string and made the Message body of an email message. Here is the code:

doCmd.Sendobject, acSendNoObject,,,"joebloggs@bloggs.net",,,"EMAIL SUBJECT", Me.MyTextBox.Text

If I type some text into my text box and then hit enter, I get a new line and can keep entering more text. This new line appears in the email when I run the above code.

I want to be able to be able to enter a new line into the text box with code. When my form loads, I will be automatically setting the text in this text box from data in my tables. For example, in the following line of code, how do I insert the new line?

Me.MyTextBox.Text = Me.MyTextBox.Text & <need to insert a new line> & recordSet("aField")

Thanks very much,

Peter




[This message has been edited by Essendon (edited 05-06-2002).]
 
Sorry, I found it using the search facility.

Me.MyTextBox.Text = Me.MyTextBox.Text & vbNewLine & recordSet("aField")



[This message has been edited by Essendon (edited 05-06-2002).]
 

Users who are viewing this thread

Back
Top Bottom