By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,399 Members | 984 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,399 IT Pros & Developers. It's quick & easy.

Re-use report by using a query to filter

P: n/a
Hi,

suppose I have one report that reports some data to me based on a
functional area that I define. We have about 20 func_areas and every
time the report is the same.
Is there some way to have the report ask me (based on a query or
something) what func_area I would like the report to be based on?

ps. the report is based on a query so ultimately the selection has to
be passed to the query.

Thx in advance, Sean
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Sounds like the report is already based on the query?

If this is true, then in your query in the criteria field for
func_area
put this: [Functional Area?]

Then when you run the report, this addition to your query will prompt
you for the func_area before the report is shown with the results.

-Paul

se*****@reeve.nl (seansan) wrote in message news:<cd**************************@posting.google. com>...
Hi,

suppose I have one report that reports some data to me based on a
functional area that I define. We have about 20 func_areas and every
time the report is the same.
Is there some way to have the report ask me (based on a query or
something) what func_area I would like the report to be based on?

ps. the report is based on a query so ultimately the selection has to
be passed to the query.

Thx in advance, Sean

Nov 12 '05 #2

P: n/a
se*****@reeve.nl (seansan) wrote in message news:<cd**************************@posting.google. com>...
Hi,

suppose I have one report that reports some data to me based on a
functional area that I define. We have about 20 func_areas and every
time the report is the same.
Is there some way to have the report ask me (based on a query or
something) what func_area I would like the report to be based on?

ps. the report is based on a query so ultimately the selection has to
be passed to the query.

Thx in advance, Sean


As long as you just want to see some subset of the data, then it's a
snap. You just pass a valid WHERE clause when you issue the
DoCmd.OpenReport command in your code... so there's not really any
need to put parameters in your query at all.

This is really lame code, sure. It's simple on purpose. I have a
combobox, "cboAnimal", and a button. From the combobox, I can pick
some animal, and when I click the button, the report opens with only
the records that match that animal. So you can build your filter on
the fly if you want.
Private Sub cmdPreviewReport_Click()

DoCmd.OpenReport "rptAnimals", acViewPreview, , "[Animal]='" &
Me.cboAnimal & "'"

End Sub

If you need to specify one of several criteria (say several animals in
this case) for your report, you could use a multi-select listbox and
grab the code from here and do it...

"Use Multiselect listbox to limit records in report"
http://www.mvps.org/access/reports/rpt0005.htm
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.