The problem is that whenever I try to use ItemData to pull the value of the index field, it returns null, even if I specify the number of a row from the combobox that I know is a valid argument.
Here's the scenario:
I have a combobox selecting 2 fields from a table as its rowsource. One field is an index and the other is an index field. The bound column is set to the index field.
Here's the code:
Private Sub cboCountry_AfterUpdate()
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "idsCountryID = " & Me.cboCountry.ItemData(Me.cboCountry)
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
End If
rs.Close
Set rs = Nothing
End Sub
When debugging, I can see that Me.cboCountry is evaluating to 0, 1, 2, or 3 depending on what the combobox has selected and Me.cboCountry.ItemData(Me.cboCountry) is evaluating to null even though there is definately data in rows 0, 1, 2, and 3 of the combobox.
Any suggestions? Thanks ahead of time.
Here's the scenario:
I have a combobox selecting 2 fields from a table as its rowsource. One field is an index and the other is an index field. The bound column is set to the index field.
Here's the code:
Private Sub cboCountry_AfterUpdate()
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "idsCountryID = " & Me.cboCountry.ItemData(Me.cboCountry)
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
End If
rs.Close
Set rs = Nothing
End Sub
When debugging, I can see that Me.cboCountry is evaluating to 0, 1, 2, or 3 depending on what the combobox has selected and Me.cboCountry.ItemData(Me.cboCountry) is evaluating to null even though there is definately data in rows 0, 1, 2, and 3 of the combobox.
Any suggestions? Thanks ahead of time.