Solved-RS.FindFirst and Multiple Column ComboBox
Hello All:
I am using Access XP. I have an unbound combo box that is set for displaying three columns and the bound column is one. I have a query in the rowsource as follows:
SELECT DISTINCT [OrderName], [PrimaryWorkGroup], [SecondaryWorkGroup] FROM Orders ORDER BY [OrderName], [PrimaryWorkGroup], [SecondaryWorkGroup];
Here is what I have in my after_update subroutine:
Private Sub cbosOrderName_AfterUpdate()
Set rs = Me.Recordset.Clone
rs.FindFirst ("[OrderName] = '" & Me![cbosOrderName] & "' AND [PrimaryWorkGroup] = '" & Me.cbosOrderName.Column(3) & "' AND [SecondaryWorkGroup] = '" & Me.cbosOrderName.Column(4) & "'")
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
All it does is select the first record. I can have multiple PrimaryWorkGroups or SecondaryWorkGroups. I am missing something.
Thank you for any advice,
Tony
Edit...I always forget about the wizard. I used it and it worked fine.
Thanks,
Tony
|