A
A Man
I'm still working on issues in earlier threads. When I use code to
change my report's .Filter and set .FilterOn to true, I get no records.
When I manually go to the report design, change the .Filter and
..FilterOn, I also get no records.
Here's the code I use to change .Filter via code:
sWhere = "[cus_no] = '" & sCustnum & "'"
DoCmd.OpenReport sReportname, acViewDesign ' Must come before "set rpt"
Set rpt = Reports(sReportname)
rpt.Filter = sWhere
rpt.FilterOn = True
DoCmd.Close , , acSaveYes
DoEvents ' Allow Access to save report.
What's wrong?
Why is Access ignoring the .Filter property even though .FilterOn is
True (or Yes in the property box).
change my report's .Filter and set .FilterOn to true, I get no records.
When I manually go to the report design, change the .Filter and
..FilterOn, I also get no records.
Here's the code I use to change .Filter via code:
sWhere = "[cus_no] = '" & sCustnum & "'"
DoCmd.OpenReport sReportname, acViewDesign ' Must come before "set rpt"
Set rpt = Reports(sReportname)
rpt.Filter = sWhere
rpt.FilterOn = True
DoCmd.Close , , acSaveYes
DoEvents ' Allow Access to save report.
What's wrong?
Why is Access ignoring the .Filter property even though .FilterOn is
True (or Yes in the property box).