missing operator

Shawny

Registered User.
Local time
Today, 11:29
Joined
Apr 15, 2000
Messages
64
I am still haveing trouble with this code.
'Get name
Set dbInst=CurrentDb
Set rstInst=dbInst.OpenRecordset("Instrument",dbOpenDynaset&_
strCriteria="[InstCode]="&Trim(Str(OpenArgs))
rstInst.FindFirst strCriteria
strID=rstInst![name]
InstCode=OpenArgs

I put a breakpoint on the line that starts strID,then open the form (run the debugger), and I get a syntax error message ( missing operator)
If I put a breakpoint on the findfirst line, the form opens with no error message.
The code looks OK to me. How can this be happening?
 
Maybe you've already thought of these but anyway...

Is your [InstCode] field a Text field?

If it is the comparison value will need single quotes around it i.e.

strCriteria="[InstCode]='" & Trim(Str(OpenArgs)) & "'"

If that isn't it or it still doesn't work I'd have a look at the OpenArgs variable to check that it isn't <Null>.

Best of luck.

[This message has been edited by Dembrey (edited 03-11-2002).]
 
try

Set rstInst=dbInst.OpenRecordset("Instrument",dbOpenDynaset)

strCtriteria="[InstCode] = "&Trim(Str(OpenArgs))
 

Users who are viewing this thread

Back
Top Bottom