Hi,
In an older version of Access, I created a form with various combo boxes to search the underlying record (search whilst typing)
For instance, First name, Surname & Address.
The boxes are linked together with an ID field so that the same underlying record is shown irrespective of which box is used for the search.
However, I've discovered that in the current version of Access (2007-2013), I can't reproduce the behaviour despite hours of head scratching.
Originally, I used the combo box wizard and then included the ID field on the form.
For the "On current" [Event Procedure] for the form I put:
Code:
Private Sub Form_Current()
Combo1 = ID
Combo2 = ID
Combo3 = ID
End Sub
And for the "After Update" [Event Procedure] for the combo box the wizard would generate:
Code:
Private Sub Combo1_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Me![Combo1])
Me.Bookmark = rs.Bookmark
End Sub
(I should say my skills are very limited and I don't understand the above code - it's what the wizard generated)
As I mentioned, for some reason, this doesn't work in the newer version of Access and instead just shows the ID field in each box.
I'd be extremely grateful for some help on this.
Regards
Jon