Report using a Forms filtered record set

  • Thread starter Thread starter Noel
  • Start date Start date
N

Noel

Hi. Ive had an idea for a Report linked to a Form which Im
sure someone must have thought of before but I havent seen
it in any books or sample dbs. Imagine an ordinary Form on
which the user performs the usual Filters and then perhaps
sorts the filtered records. Now imagine they click on a
command button at the bottom of the form which opens a
predesigned Report, which displays the filtered and sorted
record set. Can this be done? I know how to do everything
but transfer the record set directly to the Report. If its
possible, I would ideally like to be able to build this
around existing forms, as well as designing ones
specifically with this technique in mind. Any ideas and/or
examples? Thanks, Noel
 
If I'm reading it right, I think it's possible.
Make the report using the Report Wizard. You might need several goes at it, but if I can do it in a couple of tries, then so can you.
Next make a command button in your form from the Toolbox, also using the wizard. This time going to make a report button that does whatever you want.

I hope that helps.
 
Thanks Roger. In finding your reply I realised I put this
post in New Users, rather than General Questions. Your
advice is perfect but in doing it your way, the report
would simply bring up the data that it is fed by whatever
table or query you specify. It will not take the sorted
and filtered results direct from the Form. Thanks again
for your reply. Ill repost in General Questions. Cheers,
Noel
-----Original Message-----
If I'm reading it right, I think it's possible.
Make the report using the Report Wizard. You might need
several goes at it, but if I can do it in a couple of
tries, then so can you.
Next make a command button in your form from the Toolbox,
also using the wizard. This time going to make a report
button that does whatever you want.
 
Your form would have to dynamically build a SQL string, save it, them call a
report referencing the string as a row source. There might be a need to
programmatically change the report writer. You indicated that the form can
change filters and sort order, things the report writer does independently.
This may result in multiple saved report definitions.

If you're trying to program the report writer to reduce the number of saved
report definitions via parameters generated on a form, that's well past
"GettingStarted".

Good luck! I'd like to see an example DB.
 
Back
Top