×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Text box return

Text box return

Text box return

(OP)
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 & {new line command here} & 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.

RE: Text box return

Can you add & vbCrLf & ?
If that does not work, add chr$(13) or chr$(10) (the ASCII characters for carriage return and linefeed )

RE: Text box return

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: www.essexsteam.co.uk

RE: Text box return

(OP)
Both methods work great as long as I remember to enable multiline for the testbox.

Thanks to both.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources