
June 16th, 2005, 04:48 PM
|
|
Contributing User
|
|
Join Date: Jun 2005
Posts: 54
Time spent in forums: 13 h 40 m 34 sec
Reputation Power: 4
|
|
Help with DoCmd.OpenForm
I am trying to open a form that only shows the record designated by the user. I have a list of field names they can choose from and they put in data for the "Where" part. However the compiler is saying "Run-Time Error 2465:
Access cannot find the field "|" refered to in your expression."
I get my data for the record from a query. Here is my code. I am new and barely know what I am doing so please tell me where i went wrong. Thanks
Dim strField As String 'Vari. for input from listbox
Dim strText As String 'Vari. for input from textbox
strField = Form_frmMORE!listFields.Value 'Acquiring values from form
strText = Form_frmMORE!txtData 'Acquiring values from form
DoCmd.OpenQuery "qryResults2"
DoCmd.Close acQuery, "qryResults2"
DoCmd.OpenForm "frmResults", acNormal, , [ strField Like '" & strText & "'] 'Here is where the Error is
|