First of all I am impressed by the activity on this forum and the speed in which questions get different points of view. Thank you to those supporting.
My question involves a report (fax layout). Because of the design of this report, I am unable to use the 'detail' section in the main report. As a workaround I have created two subforms and included those two subforms in the report. The information on the report needs to be filtered based on a listbox. I have created a button to activate printing the report. Before printing I set the reports' filter.
Issue: I have to set the same filter for the 'main' report and its two subreports. I created a function for setting the filter like this:
This sub is called through the following code:
Although the solution works, I don't find this solution very user friendly. MS Access starts to open screens and closing them again. The Excel wizards might be aware of the application.screenupdating feature. Does Access have something similar? Would anyone know a different approach?
I look forward to read your suggestions.
My question involves a report (fax layout). Because of the design of this report, I am unable to use the 'detail' section in the main report. As a workaround I have created two subforms and included those two subforms in the report. The information on the report needs to be filtered based on a listbox. I have created a button to activate printing the report. Before printing I set the reports' filter.
Issue: I have to set the same filter for the 'main' report and its two subreports. I created a function for setting the filter like this:
Code:
Public Sub Report_SetReportFilter(strReportName As String, strFilter As String)
Dim rpt As Report
DoCmd.OpenReport strReportName, acViewDesign
Set rpt = Reports(strReportName)
rpt.Filter = strFilter
rpt.FilterOn = True
DoCmd.Save acReport, strReportName
DoCmd.Close acReport, strReportName
Set rpt = Nothing
End Sub
This sub is called through the following code:
Code:
Call Report_SetReportFilter("subFrm1", strFilter)
Call Report_SetReportFilter("subFrm2", strFilter)
Call Report_SetReportFilter("MainForm", strFilter)
DoCmd.OutputTo acReport, "MainForm", acFormatSNP, "Output.snp"
Although the solution works, I don't find this solution very user friendly. MS Access starts to open screens and closing them again. The Excel wizards might be aware of the application.screenupdating feature. Does Access have something similar? Would anyone know a different approach?
I look forward to read your suggestions.