R
Robert
I have a main form with a datasheet subform in the footer. The purpose of
the datasheet is to select records in the main form by selecting a record on
the datasheet. The code that I have currently does do this:
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
End If
Set rs = Nothing
End Sub
The problems are that the code is executed when I click on a column to sort
the datasheet. There is no need to execute this when clicking on a column,
only when clicking on a row (record).. Also, after sorting on a column and
then clicking on a row (record), I get an error message saying that this is
an invalid bookmark.
Is there any way to avoid executing this code when clicking on a column?
And how do I get it to work after this sort has been executed?
Robert
the datasheet is to select records in the main form by selecting a record on
the datasheet. The code that I have currently does do this:
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
End If
Set rs = Nothing
End Sub
The problems are that the code is executed when I click on a column to sort
the datasheet. There is no need to execute this when clicking on a column,
only when clicking on a row (record).. Also, after sorting on a column and
then clicking on a row (record), I get an error message saying that this is
an invalid bookmark.
Is there any way to avoid executing this code when clicking on a column?
And how do I get it to work after this sort has been executed?
Robert