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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to store the list from a combo box in a variable???????

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hi,

I'm working on a project and I was wondering if it's possible to store the list from a combo box into a variable so that when the form is hidden or unloaded (it erases the list for some reason) it can be reloaded from a variable in the same order and in list format, not all on one line.

I hope that makes sense.

Cokesplash
 

You can use an array and fill it
or u can use a single variable with some delimiter ,
to identify each value .
 
In the code below the "," is used as the field separator and the command Split is used


Dim S as string
dim T as Variant

'''Load the variable
For i = 0 to (combo1.listcount-2)
s = s + combo1.list(i) + ","
next i
s = s + combo1.list(combo1.listcount-1)

'''Load the combobox
T = split(s,",")
for i = 1 to ubound(T)
combo1.additem T(i)
next i
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top