469,317 Members | 1,939 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,317 developers. It's quick & easy.

Form to filter reports

PhilOfWalton
1,430 Expert 1GB
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
Aug 4 '16 #1
0 761

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

14 posts views Thread by Nothing | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.