Introduction
Frequently we need to generate reports with one or more "From & To" ranges. Often the method of entering this range is to use an input box to enter criteria for the underlying query. I consider this not to be very professional, and prone to input errors.
If your database contains a number of these "From & To" reports, there must be a better method.
Concept
The thought occurred to me to use one input form, which changes it's appearance according to the information required to set up the filter for the report. Additionally, after entering the From & To Values, these should be passed back to the report to show the ranges in the header.
Method
Here is a picture of the form in Design View.
So far, I have not needed more than 1 Combo Box and 1 Text Box, so the Range 2 controls are not used.
On opening the report in PrintPreview, initially it is hidden.
This passes 32 pieces of information to the "ReportFilterForm" to tell the form how many pairs of Combo Boxes and Text Boxes to show, sets titles, field widths, SQLs for Combo Boxes, Default values, prompts etc.
So when it opens, the form looks like this:
It shows only the number of Combos or Text boxes as required by the report, and the form's height gets adjusted accordingly.
After filling in the ranges we get
The header of the final report shows the ranges selected in by the form.
Conclusion
I think this concept may be useful, and would welcome any comments and suggestions.
Phil