itemData inferno

FatPat

New member
Local time
Today, 03:46
Joined
Nov 5, 2009
Messages
1
Hello everyone ,it's my first time in VBA coding and i didn't know it can be so frustrating all i wanna do is fill a ComboBox from a recordset so i used the following code

''' rsPhysicians is the name of the record set and cmdPhysician is the '''combobox
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
counter = 0
With rsPhysicans

Do While Not .EOF

cmbPhysicians.AddItem ![FNAME] + " " + ![MNAME] + " " + ![LNAME]
cmbPhysicians.ItemData(counter) = ![ID]
.MoveNext
counter = counter + 1
Loop
.Close
End With

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
for some reason it keep giving me the following error:

run-time error '424'
Object required
''
the error is highliting the following line

cmbPhysicians.ItemData(counter) = ![ID]

i have no idea why and i've tried a dozen way to fill the item data but i'm failing always

please helpppppppppppp
 
why not make a query to pick the items up, and use that - much easier
 

Users who are viewing this thread

Back
Top Bottom