OpenForm command where clause with 2 criteria

isaacski

Registered User.
Local time
Today, 16:31
Joined
Nov 30, 2012
Messages
67
Hi Everyone,
I am having trouble opening Form 2 to the same record as the record in Form 1. Form 1 is a continuous form of questions. When certain response is given, I want to be able to add more information to the "additionalcomments" column for that record. I want to have the additional comments pop up in a new form.

Form 1 is based off of a query with no unique ID. I need the second form to open on Eval_Number and Question_Number. I have tried...

Code:
If Me.Response = 0 Then
DoCmd.OpenForm "frmadditionalcomments", acNormal, , "[Eval_Number] =" & Forms!ESVWL1Trainee!subfrmreponses.Eval_Number And [Question_Number] = " & Forms!ESVWL1Trainee!subfrmreponses.Question_Number "
End If

and this tells me the object doesn't support the method. Is the SQL incorrect? Is it the way its setup?

Any other suggestions?
 
Try this:
Code:
DoCmd.OpenForm "frmadditionalcomments", acNormal, , "Eval_Number=" & Forms!ESVWL1Trainee!subfrmreponses.Eval_Number & " AND  Question_Number= " & Forms!ESVWL1Trainee!subfrmreponses.Question_Number"
 
:( Got a syntax error...
 
Where is the error? If it's at the end of statement, it's because I copied over the end quotation mark by mistake.:rolleyes: If it's something else, please provide details.
 
You were right! It was the last quotation mark. It also doesn't help that I constantly misspell the word 'response'. :confused:

Thanks very much for your help!

K
 

Users who are viewing this thread

Back
Top Bottom