By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,594 Members | 2,016 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,594 IT Pros & Developers. It's quick & easy.

displaying multiple variables in one textbox or caption

P: 2
Is it possible to display more than one variable (one after another on the same line) in a text box or list box or label caption?? Having difficulty with this one... thank you.
Nov 9 '06 #1
Share this Question
Share on Google+
4 Replies


Expert 5K+
P: 8,434
Is it possible to display more than one variable (one after another on the same line) in a text box or list box or label caption?? Having difficulty with this one... thank you.
For a textbox, you need to turn on the .Multiline property.

Otherwise, there shouldn't be any problem - just concatenate using the & operator. If any further difficulty, try posting your code here.
Nov 10 '06 #2

P: 2
For a textbox, you need to turn on the .Multiline property.

Otherwise, there shouldn't be any problem - just concatenate using the & operator. If any further difficulty, try posting your code here.

Turning multiline works if I want to display variables one under the other... however, I want to display variables one beside the other.

ex.
for i = 1 to 10
txtBox.text= strVariable(i)
next i

strVariable is an array that has 10 different values. I want them all to appear one beside the other!! Can't do it so far... is there a way? Thanks for your help.
Nov 10 '06 #3

P: 15
mra
Turning multiline works if I want to display variables one under the other... however, I want to display variables one beside the other.

ex.
for i = 1 to 10
txtBox.text= strVariable(i)
next i

strVariable is an array that has 10 different values. I want them all to appear one beside the other!! Can't do it so far... is there a way? Thanks for your help.
hi please try this, if u mean it
for i = 1 to 10
txtBox.text= txtBox.text & strVariable(i)
next i
Nov 10 '06 #4

Expert 5K+
P: 8,434
Turning multiline works if I want to display variables one under the other... however, I want to display variables one beside the other.
Sorry, I should have read your message more carefully. mra's suggestion should do the trick.

You might also want to insert a space or a vbTab between them, as in...
Expand|Select|Wrap|Line Numbers
  1. for i = 1 to 10
  2.   txtBox.text= txtBox.text & vbTab & strVariable(i)
  3. next
Nov 10 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.