vbCrLf in textbox

J-F

Registered User.
Local time
Today, 11:23
Joined
Nov 14, 2001
Messages
41
Is there a way of including vbCrLf in a text box.

I have a large text box where I would like for a VbCrLf to be inserted when you press enter. I would also like the carriage return and line break to be shown in the text box by way of a new line. Similar to a <textarea> in HTML.
 
Change the textbox property [Enter Key Behavior] from {Default} to {New Line in Field}.

When a user presses {ENTER}, a new line will be started in the textbox rather than moving onto the next field. The user will now have to use {TAB} to complete the entry.

HTH
wink.gif
 
Thanks. Will this include a vbCrLf as part of the text?
 
I'm slightly confused!!
frown.gif


The method described will insert a carriage return in the textbox, which has the same effect as vbCrLf has on a variable string.

If however, you actually want the text 'vbCrLf' to appear in the textbox, then the way to achieve this is to use the [On Key Press] event in the textbox and trap for the [ENTER] key being pressed [CHR(13)] then use the SendKeys statement to pass the text to the textbox.
 
Brilliant. I have just tested it and it does exactly what I wanted it to do. Thanks for your help. Regards.

J-F
 

Users who are viewing this thread

Back
Top Bottom