how to cut off textbox information

C

cmdolcet69

How can you cut off extra information from a .text combo box. In muy
combo boxes i have teh following information combobox 1: 2-5/3"
combobox 2: 3-1"
combobox 3: 4-50.00mm

How can i populate my text box with only the 234

which is the start of each combobox text in the list.
 
R

rowe_newsgroups

How can you cut off extra information from a .text combo box.  In muy
combo boxes i have teh following information combobox 1: 2-5/3"
                 combobox 2: 3-1"
                 combobox 3: 4-50.00mm

How can i populate my text box with only the 234

which is the start of each combobox text in the list.

How do you add the information to the combobox? That's where you need
to trim the data.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
 
L

Lloyd Sheen

cmdolcet69 said:
How can you cut off extra information from a .text combo box. In muy
combo boxes i have teh following information combobox 1: 2-5/3"
combobox 2: 3-1"
combobox 3: 4-50.00mm

How can i populate my text box with only the 234

which is the start of each combobox text in the list.

If each combobox starts with a one character numeric then you can use:

dim newText = comboboxControl.text.substring(0,1)

If there can be numbers greater than 9 and "-" is always the delimeter
then use:

dim charCount as integer= instr(comboboxControl.text,"-")-1
dim newText = comboboxControl.text.substring(0,charCount)

Untested but you get the idea.

LS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top