Dynamic filters on a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

What I am trying to acieve is an on-screen report with user-selectable
filters. The app is a detention-logging system for a school. What I want to
be able to do is to see a summary of all of the detentions for the school,
but allow the user to filter this down to either a particular year group or
even a particular tutor group. I also want them to be able to alter the
date-range for the report.

What I'd ideally like to do is to have a form do this, but forms don't seem
to support grouping of data and I can't have a sub-form on a continuous form.

I have two (current) problems with the report, which I would appreciate help
with....

1) How can I get the report to re-size to fill the screen width?

2) How do I place a button on the report which will activate a form to do
the filtering? (I think I'm ok once I've got the form open, but we'll see!)
Ideally this button would not show if the report is printed / exported. As it
stands, I can create a button, but not get it to work! (The zoom tool remains
active)

HELP!

TIA
 
1) you can add code to the On Open event of the report like:
DoCmd.Maximize
You can restore the screens in the On Close event of the report.

2) most of us old/experienced Access report writers will create a form that
opens first where the users can select the appropriate criteria in text
boxes, combo boxes, or whatever. After they have set whatever criteria they
desire, they click a button to open the report. You can either hard-code the
criteria in the report's record source or open the report with a where
condition.
 
Humm, thanks for that.

Follow ons...

1) Will that scale the report? It isn't about making the window grow, but
about making the report width fit the window width.

2) I want the report to open with no filters and then allow the user to set
and change the filters at will. The filters form could be opened several
times during a single display of the report. I was also hoping (later) to be
able to set up a "drill down" where clicking on the summary for, for example,
a student would open a detail report on that student. This will naturally
require an object in the report with an "onClick" event...

I look forward to your comments...

Paul
 
1) in the code that opens the report, you can add a line to zoom
DoCmd.OpenReport stDocName, acPreview, , strWhere
DoCmd.RunCommand acCmdZoom100
2) once a report has opened, it has opened. Access 2007 adds some nice
interactive features but previous versions must be closed and re-opened.
 
Thanks again for your help.

1) Is there a "fit to width" option, or is 100% about as good as I can get?

2) I see. So there isn't a reQuery option? Also, why do I have the option to
place a button on a form (and even make it a hyperlink!) if this won't work?
Seems a bit restrictive to me. Ho humm.

Paul
 
Back
Top