[RESOLVED] Filling a ComboBox with a Recordset: Error 3265
Visual Basic Segment:
VB Code:
With rsTipModels
Me.Combo_Option_Selection_Tip_Model_Type.Clear
While Not .EOF
MsgBox .Fields(!MODEL_NUMBER) 'A) Same Error
MsgBox .Fields("MODEL_NUMBER").Value 'B) Same Error
MsgBox .Fields(!MODEL_NUMBER) 'C) Same Error
MsgBox .Fields("MODEL_NUMBER").Value 'D) Same Error
Me.Combo_Option_Selection_Tip_Model_Type _ 'E) Same Error
.AddItem .Fields("MODEL_NUMBER").Value
.MoveNext
Wend
End With
I thought I had this figured out. Unfortuanaly, I lost the source I was using to figure it out and can't find it again.
Help!
Thanks,
Re: Filling a ComboBox with a Recordset: Error 3265
are u sure thats the correct name of the field? because Error 3265 mean it cannot find the field u are referring too
Re: Filling a ComboBox with a Recordset: Error 3265
If Error 3265 stands for
"Item cannot be found in the collection corresponding to the requested name or ordinal"
then it's very self-explanatory: field name "MODEL_NUMBER" in your recordset does not exist. Check your sql statement (if you selecting it) or actual table (for existence).
Re: Filling a ComboBox with a Recordset: Error 3265
MODLE_NUMBER is the spelling in the DB. Thanks.. and I thought I was just loosing my mind.
Re: Filling a ComboBox with a Recordset: Error 3265
Use
MsgBox .Fields(MODEL_NUMBER)
or rs!MODEL_NUMBER if I'm not mistaken
Re: Filling a ComboBox with a Recordset: Error 3265
VB Code:
With rsTipModels
Me.Combo_Option_Selection_Tip_Model_Type.Clear
While Not .EOF
If (.Fields("MODEL_NUMBER") & "") <> "" Then
Me.Combo_Option_Selection_Tip_Model_Type.AddItem .Fields("MODEL_NUMBER").Value
End If
.MoveNext
Wend
End With
works Great!
Re: Filling a ComboBox with a Recordset: Error 3265
Quote:
Originally Posted by Smeg-Head
MODLE_NUMBER is the spelling in the DB. Thanks.. and I thought I was just loosing my mind.
That explains... :) :afrog: