I get an intermittent "Run-time error '-2147417848 (80010108)': Method 'Bookmark' of object 'Recordset2' failed" at the Bookmark assignment indicated below.
Usually the code works fine with no error, and even after getting the error, if I try again, it usually works. Is Bookmark a Method, and where did Recordset2 come from ? Any ideas welcome.
Code:
Private Sub SearchForItemID_AfterUpdate()
Dim rs As DAO.Recordset
If Not IsNull(SearchForItemID) Then
Set rs = Me.RecordsetClone
rs.FindFirst "ItemID=" & SearchForItemID
If rs.NoMatch Then
MsgBox "Item " & SearchForItemID & " not found in this Sale Event", vbOKOnly + vbExclamation, gstrAppName
Else
Me.Recordset.Bookmark = rs.Bookmark !<------------------
End If
rs.Close
SearchForItemID = Null
End If
End Sub
Usually the code works fine with no error, and even after getting the error, if I try again, it usually works. Is Bookmark a Method, and where did Recordset2 come from ? Any ideas welcome.