We help IT Professionals succeed at work.

Convert TextBox Input into Variables

rmocogni asked
Last Modified: 2008-03-04
I have a program that reads in different sensors (temperature, humidity, etc) and I want the user to be able to pick which inputs get logged to a file.  Is there a way that I can use a text box to allow the user to pick which inputs get logged?  For example the user would enter - TempA,TempB,TempC.  Thanks.

Watch Question

Brian MulderFreelance
Top Expert 2006

Hello rmocogni,

just an idea you could try using a checkbox before the textbox and in your code check if one is checked and log that to file




Thanks for the suggestion, but I want the user to be able to choose the order of the logging also.

High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Top Expert 2009
This one is on us!
(Get your first solution completely free - no credit card required)
Mike TomlinsonHigh School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Top Expert 2009

*** You can also put the variables into a Class.  Replace the "Me" in the CallByName() line with a reference to your Class instance.
Brian MulderFreelance
Top Expert 2006

well, you could indeed use a textbox but then you need to parse the string which is also relatively easy with the split function

then in your code you could check each string part in the array if it is a correct option relating to your variables

dim str() as string

str() = split(textbox.text, ",")
for i = 0 to UBound(str)
  if str(i) = "temp" or str(i) = "somethingelse" then
    log your line here
  end if
next i
You could put a dropdown list next to each textbox.  Each list would contain the numbers 1- N, where N is the number of textboxes.  The number selected would be the order number.

Obviously, you'd have to validate their selection, e.g. prevent two number 1s.  

If you wanted to get fancy, after someone selects a value, say 1, repopulate all the other lists so they contain the numbers 2 - N.


Idle Mind,

Thanks, that is exactly what I needed.


Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.