strvariant <no.email.com> wrote in
news:Xn***********************@216.196.97.136:
I can do some pretty sophisticated things with VBA but the custom
report/filter idea has always been one of those areas that I have
neglected to focus on. Mainly because of how near and dear I hold
reports. You're right about the hundreds of 'duplicate' reports
that multiply on top of each other. I'd be interested in setting
up a 'report command center' so to speak. That would help make
reports much more interesting for me. Any sites that might have
some examples on such a thing? Beyond the normal 'Date Range'
textboxes that generally get put on the reports already?
I use what I call a "report switchboard" in my apps. An example can
be seen here:
http://www.bway.net/~dfassoc/Park/Reports.html
It's basically driven off a table populated with the names of the
reports along with friendly descriptions and fields that define
certain characteristics, such as how to open the report (directly
via DoCmd.OpenReport, by calling code, or by opening a dialog form).
Another example that's more complex, since it has a high-level
choice that is made before most reports are printed is here:
http://www.dfenton.com/DFA/examples/...witchboard.gif
In both cases, when a filtered report is called directly, it means
that there's a dialog form called called in the report's OnOpen
event that pulls the criteria from the dialog form and changes the
recordsource of the report to reflect the filter criteria.
In other cases, I use a class module as a data storage structure.
This is particularly helpful for printing groups of reports that
need to use the same criteria, but you don't want to annoy the user
with multiple dialogs. The second example above uses a class module
to store the campaign choice and all the choices made from dialogs.
The OnOpen events of the reports refer then to the class module
instead of opening the dialog form. In a few cases, I set up the
OnOpen event so that if the class module has not been initialized,
then it opens the dialog form directly, but otherwise skips the
dialog.
I've been intending for quite some time to put together a sample
database, and even started in on it a little over a year ago, but
never got around to finishing it up.
It's too bad the question didn't come up last week, when I had time
-- I would have gone ahead and finished it up, but this week is way
too busy!
--
David W. Fenton
http://www.bway.net/~dfenton
dfenton at bway dot net
http://www.bway.net/~dfassoc