Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text box return

Status
Not open for further replies.

bpeirson

Structural
Joined
Apr 7, 2003
Messages
147
Location
CA
How do I enter a carriage return or next line in a text box?
The code I have is this:
Code:
 Chosen_items.Value = Chosen_items.Value & " " & Qty_Box.Value & " Each " & Part_Box.Value
What I want is:
Code:
 Chosen_items.Value = Chosen_items.Value & [COLOR=red yellow]{new line command here}[/color red yellow] & Qty_Box.Value & " Each " & Part_Box.Value

Chosen_items is the name of the text box. This code is in a loop which adds items into the box as the user chooses them.

Currently the items appear in a sequential line one after another, this is very hard to read.

All suggestions are appreciated.
 
Can you add & vbCrLf & ?
If that does not work, add chr$(13) or chr$(10) (the ASCII characters for carriage return and linefeed )
 
Code:
Chosen_items.Value = Chosen_items.Value & vbCRLF & Qty_Box.Value & " Each " & Part_Box.Value

Don't forget to set the Multiline property of the Chosen_Items textbox to True

Good Luck
johnwm
________________________________________________________
To get the best from these forums read faq731-376 before posting

UK steam enthusiasts:
 
Both methods work great as long as I remember to enable multiline for the testbox.

Thanks to both.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top