Click to See Complete Forum and Search --> : selecting a data from combo box


January 11th, 2000, 04:46 AM
HI!
On a form I have a combo box and 6-7 text boxes. The list of items in combo box is a list of names from
a table in SQLServer using ADO connection. Now I want to retrieve data pertaining to the selection made in
combo box and put the data into all the 6-7 text boxes.....I want to basically update a record in a table selected
thru the combo box.
can anybody help?

Ranjit Goray
January 13th, 2000, 05:30 AM
Well if the Field that you are entering in the combo box is name and say it has a primary key asscociated to it..
e.g. No.1,2,3,4,5,6,7 and the corresponding names to it...

and you want to select according to the no then...

on adding the items in the combo...also load an array with the nos. associated to ie..
redim srtmp(0)
artmp(0)=0
i=0
cbtmp.clear
while not rs.eof
cbtemp.additem (name),i
redim preserve artmp(ubound(artmp)+1)
artmp(ubound(artmp)-1)=No
rs.movenext
wend
rs.close

and on combo click event select the respective data by the no in the array
i.e. artmp(cbtmp.ListIndex)