G
Guest
I have a combo box in the header section of a form, I have the code below in
the after update event to find the record that goes with the item selected in
the combo box. The problem is, some of the selections will have more than
one record associated with them. With the form in normal view it's fine for
the ones that only have one record, but on those with multiple records, it
will only show the first one. Which makes sense because I'm using FindFirst.
When I put the form in continuous view, which is actually the way I want it-
it displays all the records not just the ones matching the combo selection.
I'm sure there is something else I need to use here besides FindFirst, but I
don't know what. How can I make it display all the records associated with
the selection in the combo box??? The form is based on a query if that
matters.
Public Sub cboLabName_AfterUpdate()
Dim rst As DAO.Recordset
Set rst = Me.Recordset.Clone
rst.FindFirst "[Lab Name] = '" & Me![cboLabName] & "'"
Me.Bookmark = rs.Bookmark
Me.Detail.Visible = True
End Sub
Any ideas would be greatly appreciated, Thanks.
the after update event to find the record that goes with the item selected in
the combo box. The problem is, some of the selections will have more than
one record associated with them. With the form in normal view it's fine for
the ones that only have one record, but on those with multiple records, it
will only show the first one. Which makes sense because I'm using FindFirst.
When I put the form in continuous view, which is actually the way I want it-
it displays all the records not just the ones matching the combo selection.
I'm sure there is something else I need to use here besides FindFirst, but I
don't know what. How can I make it display all the records associated with
the selection in the combo box??? The form is based on a query if that
matters.
Public Sub cboLabName_AfterUpdate()
Dim rst As DAO.Recordset
Set rst = Me.Recordset.Clone
rst.FindFirst "[Lab Name] = '" & Me![cboLabName] & "'"
Me.Bookmark = rs.Bookmark
Me.Detail.Visible = True
End Sub
Any ideas would be greatly appreciated, Thanks.