Find record from combo selection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using the standard code provided by the wizard to go to a record on my
form based on the selection in a combo. The code is as follows:

Private Sub Combo66_AfterUpdate()

' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone

'this modification of the standard code is necessary
'because some of the titles may contain apostrophes
rs.FindFirst "[Title] = '" & Replace(Me![Combo66], "'", "''") & "'"

Me.Bookmark = rs.Bookmark

End Sub

The database contains music titles, and I have a problem because some of the
titles are identical, even though they may refer to different pieces of
music. When I select a duplicate title the form goes to the first instance of
that title regardless of which one I select. I assume this is because the
search always starts from the beginning of the recordset. How can I make it
start from wherever it is in the recordset at the time of the selection?

Thanks
 
You need to use rs.FindNext, give it a go, hopefully it will work otherwise
you may have to store your position in a variable and start at that point
each time, I would like to understand what you are try to achieve because
there maybe better way to acheive what you want.
 
Back
Top