marysilvaramos
Registered User.
- Local time
- Today, 11:28
- Joined
- Oct 22, 2012
- Messages
- 25
Hello to All:
I am trying to filter a report using a form. The form has the following combo boxes (until now) to filter the report:
txtSchool Year (ie: 2012-2013)
numQuarter (ie: 1,2,3,4)
txtStudent Name (ie: Doe, jane)
Now, the search options include all the fields, one or more fields or none of them (this option should print all the info in the table). I do not have issues when all the fields have data, the problem starts when one or more are empty. I am trying to use wildcards to include all the records in case the field is empty, but the syntax some how is not ok.
Here is my current code:
strWhereQuarter = IIf(IsNull([Forms]![ReportCardFilterForm]![Quarter]), "Quarter = #", "Quarter = [Forms]![ReportCardFilterForm]![Quarter]")
strWhereSchoolYear = "txtSchoolYear = [Forms]![ReportCardFilterForm]![txtSchoolYear]"
DoCmd.OpenReport "ReportCardsUnion", acViewReport, , strWhereQuarter and strWhereSchoolYear
Thanks in advance,
Mary
I am trying to filter a report using a form. The form has the following combo boxes (until now) to filter the report:
txtSchool Year (ie: 2012-2013)
numQuarter (ie: 1,2,3,4)
txtStudent Name (ie: Doe, jane)
Now, the search options include all the fields, one or more fields or none of them (this option should print all the info in the table). I do not have issues when all the fields have data, the problem starts when one or more are empty. I am trying to use wildcards to include all the records in case the field is empty, but the syntax some how is not ok.
Here is my current code:
strWhereQuarter = IIf(IsNull([Forms]![ReportCardFilterForm]![Quarter]), "Quarter = #", "Quarter = [Forms]![ReportCardFilterForm]![Quarter]")
strWhereSchoolYear = "txtSchoolYear = [Forms]![ReportCardFilterForm]![txtSchoolYear]"
DoCmd.OpenReport "ReportCardsUnion", acViewReport, , strWhereQuarter and strWhereSchoolYear
Thanks in advance,
Mary