I am having troulble searching for a record on a form. The form is a subform. The error is on the FindFirst. The message is as follows.
The Microsoft Jet database engine does not recognize 'Forms!frmSAIDEEMain!sfrmHRReq.Form!fldReqID' as a valid field name or expression.
Someone gave me the link http://www.mvps.org/access/forms/frm0031.htm but that did not help. I redid the program and the code is below. I am just trying to search for a record on a form.
Thanks ahead of time. I am getting frustrated at this.
TPrivate Sub Find_Req_Click()
On Error GoTo Err_Find_Req_Click
Dim Criteria As String
Dim FindID As String
Dim MyRs As DAO.Recordset
Dim MyForm As Form
FindID = InputBox("Find Req ID")
Set MyForm = Screen.ActiveForm
Set MyRs = MyForm.RecordsetClone
MyRs.Bookmark = MyForm.Bookmark
'Criteria = "[fldReqID] = """ & FindID & """"
Criteria = "Forms!frmSAIDEEMain!sfrmHRReq.Form!fldReqID = " & FindID
MsgBox "after find"
If MyRs.NoMatch Then
MyForm.Bookmark = MyRs.Bookmark
Set MyForm = Nothing
Set MyRs = Nothing