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

Combo box or list box?

Status
Not open for further replies.

Smithsco

Technical User
Mar 30, 2003
89
AU
I have filled combo1 with data from an ADODB connection, I then need to grab the text vale from that box later on.

I can grab the value by combo1.text but I need to automatically go to the next item in the list so some thing like

for y = 1 to combo1.listcount
newstring = combo1.text
call exporter(newstring)
combo1.movenext
next y

I know this code will not work but is there something like this that will do the same job?
 
for y = 0 to combo1.listcount - 1
newstring = combo1.list(y)
call exporter(newstring)
combo1.movenext
next y

Is 'combo1.movenext' a function?

If not then remove it.
 
Might be easier to just grab the values you need from the ado that feeds this combobox, using MyAdo.Recordset.Fields(X) where X is the number of the column (starting with 0). That way, you can simply use MyAdo.Recordset.MoveNext to get to the next record, and use a "Do While MyAdo.RecordSet.EOF = False" or something to make sure it stops at the end.


"Much that I bound, I could not free. Much that I freed returned to me."
(Lee Wilson Dodd)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top