Filtering multiple fields from a form to open a report

311 Views Asked by At

MS Access Database: I have a report that I want to open from a form with multiple filter fields. Each filter works fine when used individually. They do not work when I try combining them.

DoCmd.OpenReport "Lessons Learned", acViewReport, , "Customer = '" & CustName & "'"

DoCmd.OpenReport "Lessons Learned", acViewReport, , "Phase = '" & ProjectPhase & "'"

When I try combining them with AND, I get errors

DoCmd.OpenReport "Lessons Learned", acViewReport, , "Phase = '" &ProjectPhase&"'" And "[Customer] = " & CustName& "'"

I have been trying to resolve this for weeks. Thank you

0

There are 0 best solutions below