I have an Access 2002 database I am working on but, alas, have practically no knowledge of VBA. I am using the following code to find a record on one form using a combo box on another form. I got this here many years ago and it seemed to work in Access 97. Here is my code:
Private Sub Box9_Click()
Dim db As DAO.Database, rst As DAO.Recordset
Dim frm As Form, Criteria As String
Set db = CurrentDb()
Set frm = Forms![frmSearchbyPosition]
Set rst = frm.RecordsetClone
Criteria = "[Position]='" & Me![Position] & "'"
rst.FindFirst Criteria
frm.Bookmark = rst.Bookmark
Set rst = Nothing
Set frm = Nothing
Set db = Nothing
DoCmd.Close
End Sub
Now when I click the button, I get the following message:
Run-time error '7951'
You entered an expression that has an invalid reference to the Recordset Clone property.
Any ideas to resolve this issue would surely earn a star and my deep gratitude. Thanks in advance
Private Sub Box9_Click()
Dim db As DAO.Database, rst As DAO.Recordset
Dim frm As Form, Criteria As String
Set db = CurrentDb()
Set frm = Forms![frmSearchbyPosition]
Set rst = frm.RecordsetClone
Criteria = "[Position]='" & Me![Position] & "'"
rst.FindFirst Criteria
frm.Bookmark = rst.Bookmark
Set rst = Nothing
Set frm = Nothing
Set db = Nothing
DoCmd.Close
End Sub
Now when I click the button, I get the following message:
Run-time error '7951'
You entered an expression that has an invalid reference to the Recordset Clone property.
Any ideas to resolve this issue would surely earn a star and my deep gratitude. Thanks in advance