Hi All,
I am working on a form with a couple of list boxes on it. I want the values chosen to drive the criteria of a report that comes up. The Do command to open the report opens fine with the one criteria in the where clause, however when I add the "and" part I get a type mismatch when bringing the report up. Here is my code:
If Me.List7 <> "ALL" Then
DoCmd.OpenReport stDocName, acPreview, , "arepsec = '" & Me.List7 & "'" And "submit1 = X "
Else: DoCmd.OpenReport stDocName, acPreview
Can someone tell me what is wrong with the syntax after the "And" ? all I want to do is get records with avalue of "X" for that field.
Any help is greatly appreciated.
Thanks,
D
I am working on a form with a couple of list boxes on it. I want the values chosen to drive the criteria of a report that comes up. The Do command to open the report opens fine with the one criteria in the where clause, however when I add the "and" part I get a type mismatch when bringing the report up. Here is my code:
If Me.List7 <> "ALL" Then
DoCmd.OpenReport stDocName, acPreview, , "arepsec = '" & Me.List7 & "'" And "submit1 = X "
Else: DoCmd.OpenReport stDocName, acPreview
Can someone tell me what is wrong with the syntax after the "And" ? all I want to do is get records with avalue of "X" for that field.
Any help is greatly appreciated.
Thanks,
D