In a form in Access 2007, I have synchronized two combo boxes using the code below in a AfterUpdate event procedure. It works as it should....
-----------------------------------
Private Sub basinID_AfterUpdate()
' Update the row source of the playID combo box
' when the user makes a selection in the basinID
' combo box.
Me.playID.RowSource = "SELECT playID, playName FROM" & _
" tblPlays WHERE basinID = " & _
Me.basinID & _
" ORDER BY playName"
Me.playID = Me.playID.ItemData(0)
End Sub
------------------------------------
However, if I navigate to a new record and then return to previously entered records, the combo box values are no longer properly displayed.
The previously entered values do exist as they should in the underlying table, but they do not display correctly in the form.
Does anyone know how to alter the above code so that it will properly display existing values when the user returns to previously entered records?
Thanks very much for any assistance.
Steve
-----------------------------------
Private Sub basinID_AfterUpdate()
' Update the row source of the playID combo box
' when the user makes a selection in the basinID
' combo box.
Me.playID.RowSource = "SELECT playID, playName FROM" & _
" tblPlays WHERE basinID = " & _
Me.basinID & _
" ORDER BY playName"
Me.playID = Me.playID.ItemData(0)
End Sub
------------------------------------
However, if I navigate to a new record and then return to previously entered records, the combo box values are no longer properly displayed.
The previously entered values do exist as they should in the underlying table, but they do not display correctly in the form.
Does anyone know how to alter the above code so that it will properly display existing values when the user returns to previously entered records?
Thanks very much for any assistance.
Steve