Help with vb code for a simple form
at the moment i enter a reference in a combo box and the code then returns in datasheet view the first record it finds for that refernence in the record set
Private Sub Combo68_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[EXTERNAL_REF] = '" & Me![Combo68] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
What i want to do is find all the records that match that reference does anyone know how to do this?
Is there a simple rs. function that can do this for me that i simply do not know about?
Many Thanks
Dan Stead
Re: Help with vb code for a simple form
To find all of the records you may be able to use a Filter (I'm not quite sure how, as I don't use it myself), or you could simply re-open the recordset with a Where clause that contains your condition, eg:
Code:
Me.Recordset.Close
Me.Recordset.Open "SELECT * FROM tablename WHERE [EXTERNAL_REF] = '" & Me![Combo68] & "'"