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
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