projecttoday
Programmer
I have a single-record form with a datasheet subform of the entire table in the footer per the user's request. When the user clicks on a record on the datasheet, the single record goes to that record. It is accomplished with the code below in the on-click event of the datasheet subform. The problem is that it doesn't work after sorting the datasheet. I get an invalid bookmark error.
Private Sub Form_Click()
Dim num1 As Integer
num1 = [id]
Dim rs As Object
Set rs = Me.RecordsetClone
rs.FindFirst "[id] = " & num1
If Not rs.EOF Then
Forms.frmattendanceupdate.Bookmark = rs.Bookmark 'Error on this statement: invalid bookmark
End If
Set rs = Nothing
End Sub
Can anyone suggest a way so that this record search will work after the datasheet has been sorted.
Private Sub Form_Click()
Dim num1 As Integer
num1 = [id]
Dim rs As Object
Set rs = Me.RecordsetClone
rs.FindFirst "[id] = " & num1
If Not rs.EOF Then
Forms.frmattendanceupdate.Bookmark = rs.Bookmark 'Error on this statement: invalid bookmark
End If
Set rs = Nothing
End Sub
Can anyone suggest a way so that this record search will work after the datasheet has been sorted.