combo box recordset question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In Access 2003, I added a combo box to a new form (Combo0), set the Row
Source to a table and then added this afterupdate event.

Private Sub Combo0_AfterUpdate()
MsgBox (Combo0.ListIndex & " - " & Combo0.Recordset.Fields.Item(0).Value)
End Sub

The first time I select an item from the combo box, the record set ALWAYS
returns the first record even though the listindex is correct. Then it works
fine.
 
Why are you referring to the combobox's Recordset?

MsgBox (Combo0.ListIndex & " - " & Combo0.Value)

will give you the correct information.
 
I have mulitple fields that I want to display on the form when a user selects
from the combo box. Not just the bound column.

What is the proper way? Do a find on the refereneced table or ???
 
Combo0.Column(1) will show you the value of the 2nd column of the currently
selected row (the Column count is 0 based)
 
I get the identical information with the column property.

MsgBox Combo0.Recordset.Fields.Item(1).Value & " = " & Combo0.Column(1)

The issue is that the first time the combo is selected - it always returns
the first record, even though the listindex and the value of the combo box
return the proper record info.

Any subsequent selections return the proper information.
 
Back
Top