Output multiple lines to text box

  • Thread starter Thread starter ohaya
  • Start date Start date
O

ohaya

Hi,

I have a form with a text box. The text box has scrollbar enabled.

I am outputting several lines to the text box, and want each line to appear
as a new line, e.g., something like:

Line1
Line2
Line3
..
..
..

I am outputting vbCrLf at the end of each line, but the text box is not
putting the lines on new lines.

Is there another property in the text box I need to set, e.g., similar to
"Multiline" in VB?

Thanks,
Jim
 
me![...] = "line 1" & vbcrlf & "line 2" & vbcrlf & "line 3"

where ... is the name of your textbox control.

HTH,
TC
(off for the day)
 
TC,

That doesn't seem to work. I have "Enter key behavior" of the text control
set to "new line in field", and I've tried both vbcrlf and chr(13)+chr(10).
The lines are all just glommed together:

Line1Line2Line3...

Jim


TC said:
me![...] = "line 1" & vbcrlf & "line 2" & vbcrlf & "line 3"

where ... is the name of your textbox control.

HTH,
TC
(off for the day)


ohaya said:
Hi,

I have a form with a text box. The text box has scrollbar enabled.

I am outputting several lines to the text box, and want each line to appear
as a new line, e.g., something like:

Line1
Line2
Line3
.
.
.

I am outputting vbCrLf at the end of each line, but the text box is not
putting the lines on new lines.

Is there another property in the text box I need to set, e.g., similar to
"Multiline" in VB?

Thanks,
Jim
 
Hi TC et al,

I found a slight typo, and this now seems to be working! Thanks!

Jim



ohaya said:
TC,

That doesn't seem to work. I have "Enter key behavior" of the text control
set to "new line in field", and I've tried both vbcrlf and chr(13)+chr(10).
The lines are all just glommed together:

Line1Line2Line3...

Jim


TC said:
me![...] = "line 1" & vbcrlf & "line 2" & vbcrlf & "line 3"

where ... is the name of your textbox control.

HTH,
TC
(off for the day)


ohaya said:
Hi,

I have a form with a text box. The text box has scrollbar enabled.

I am outputting several lines to the text box, and want each line to appear
as a new line, e.g., something like:

Line1
Line2
Line3
.
.
.

I am outputting vbCrLf at the end of each line, but the text box is not
putting the lines on new lines.

Is there another property in the text box I need to set, e.g., similar to
"Multiline" in VB?

Thanks,
Jim
 
Look at the Enter Key Behaviour Property in the text box and make sur
it is set to New Line in Field and not Default. Default is to sen
cursor to next field in tab order
 
Jim

If you mis-spelled vbcrlf, but did not get a compile error, perhaps you do
not have 'Option Explicit' at the top of your module? Check that out in
online help.

HTH,
TC


ohaya said:
Hi TC et al,

I found a slight typo, and this now seems to be working! Thanks!

Jim



ohaya said:
TC,

That doesn't seem to work. I have "Enter key behavior" of the text control
set to "new line in field", and I've tried both vbcrlf and chr(13)+chr(10).
The lines are all just glommed together:

Line1Line2Line3...

Jim


TC said:
me![...] = "line 1" & vbcrlf & "line 2" & vbcrlf & "line 3"

where ... is the name of your textbox control.

HTH,
TC
(off for the day)


Hi,

I have a form with a text box. The text box has scrollbar enabled.

I am outputting several lines to the text box, and want each line to
appear
as a new line, e.g., something like:

Line1
Line2
Line3
.
.
.

I am outputting vbCrLf at the end of each line, but the text box is not
putting the lines on new lines.

Is there another property in the text box I need to set, e.g.,
similar
to
"Multiline" in VB?

Thanks,
Jim
 
Enter Key Behaviour has no affect on what happens when you enter text into
the textbox using VBA.

HTH,
TC
 
Back
Top