DoCmd.OpenForm error

svigneault

New member
Local time
Today, 14:50
Joined
Jun 15, 2012
Messages
4
I have a form to open with arguments. What I want to do is to see if a date has been treated for a particular school run. Here is my code

DoCmd.OpenForm frDates, , , "[DATES_IN] = #" & dateDTjr & "# and [CIRCUIT] = " & CmdCircuit & " , acFormReadOnly, acHidden"

Here is the message from Access:
Syntax error (missing operator) in query expression '[DATES_IN] = #28/05/12# and [CIRCUIT] = C.S.D.M., acFormReadOnly, acHidden'.

I don't know what to do with that.
Please help!!!!
 
Code:
"[DATES_IN] =" & Format(dateDTjr,"\#mm\/dd\/yyyy\#") & "and [CIRCUIT] ='" & CmdCircuit & "'"
 
Also please delete the duplicate question.
 
Thanks Galaxiom
Now the message changed to:
You entered an expression that has no value.
 
Not sure what the problem is but there should not be any quote marks after acHidden as youhave in your original post. What you have there is the last rwo arguments included in the Where Condition string.

Code:
DoCmd.OpenForm frDates, , , "[DATES_IN] =" & Format(dateDTjr,"\#mm\/dd\/yyyy\#") & "and [CIRCUIT] ='" & CmdCircuit & "'" , acFormReadOnly, acHidden
 

Users who are viewing this thread

Back
Top Bottom