R
Raymond Luxury-Yacht
Can anyone help?
I have a form bound to a table. When a drop down list on the form is
changed, I want to change the current record the form displays. I
tried using the 'usual' code to do this:
Private Sub cmbCourseAlsoRunning_AfterUpdate()
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "intCourseRefno = " & Me.cmbCourseAlsoRunning
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
End If
End Sub
However, this of course doesn't work because the form is opened with a
WHERECONDITION specified, meaning tha a filter is applied, and as such
the recordsetclone contains only the ONE record currently displayed by
the form, rather than the whole table it is based on!
So I tried changing the 'Set rs' line to this...
Set rs = CurrentDb.OpenRecordset(Me.RecordSource, dbOpenDynaset)
Unfortunately, I now get a 'not a valid bookmark' error, and have
since discovered that the bookmark can only be set using the
recordsetclone! But the recordsetclone is only one record in length!
Aaaarghh!
I would be so, so grateful for any advice anyone can offer with this
one...
I have a form bound to a table. When a drop down list on the form is
changed, I want to change the current record the form displays. I
tried using the 'usual' code to do this:
Private Sub cmbCourseAlsoRunning_AfterUpdate()
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "intCourseRefno = " & Me.cmbCourseAlsoRunning
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
End If
End Sub
However, this of course doesn't work because the form is opened with a
WHERECONDITION specified, meaning tha a filter is applied, and as such
the recordsetclone contains only the ONE record currently displayed by
the form, rather than the whole table it is based on!
So I tried changing the 'Set rs' line to this...
Set rs = CurrentDb.OpenRecordset(Me.RecordSource, dbOpenDynaset)
Unfortunately, I now get a 'not a valid bookmark' error, and have
since discovered that the bookmark can only be set using the
recordsetclone! But the recordsetclone is only one record in length!
Aaaarghh!
I would be so, so grateful for any advice anyone can offer with this
one...