View Full Version : OpenReport Method W Multiple Criteria


clauses
06-26-2002, 11:18 AM
I am trying to open a report from a form. The report is based on a query that uses several fields from the form as criteria. I am having trouble using the openreport method using multiple fields from the form. I keep getting an error that tells me my expression is to complex. The expresion I am using is taking the form:

ptrCriteria = "Field 1 = '" & Me!formValue1 & "' AND"
ptrCriteria = ptrCriteria & "Field 2 = '" & me!formValue2 & "'"
ptrCriteria = ptrCriteria & " AND Field3 = '"
ptrCriteria = ptrcriteria & Me!formValue3 & "'"

David R
06-26-2002, 11:31 AM
ptrCriteria = "Field 1 = '" & Me!formValue1 & "' AND Field 2 = '" & me!formValue2 & "' AND Field3 = '" & Me!formValue3 & "'"

I think you missed a few single quotes in there. You can always use MsgBox ptrCriteria to see if it makes sense before you run it.