Automating a report that is based on a query

  • Thread starter Thread starter Bill Knott
  • Start date Start date
B

Bill Knott

I use a query to get info on any one of 70 locations that are in my
database. I create a simple reort with the info in the query grouping
it by date.
I know how to make the query ask for the location that I want info
on , is there away to use a report template, or a macro that produces
the same layout from the query withithout creating it manually over
and over again ?
Thanks for any insite that you can provide.
 
You should be able to do this with one query and one report. Create a
parameter query that asks you for the location then create a report based on
this query. When you run the report, it should ask you for the location. Put
something like below in the criteria of the "location" field of the query:

[Enter the Location]

The [] are important. That's what makes Access ask you the question when the
query/report is run.
 
Bill

An alternate approach to the one Jerry provided is to create a form on which
you have a combobox that lists all locations. By selecting a location from
a list, you (or your users) don't have the ... 'opportunity' ... to enter an
invalid location.

Then modify your query to 'look at' the form's combobox to pick up the
parameter for that location's ID/name/whatever.

NOTE: for the query to work, the form must be open and a location selected.

NOTE 2: base your report on your query. "Order" your report by opening the
form, selecting a location, and clicking on the new command button you added
<Order Report> (which opens the report).

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
You should be able to do this with one query and one report. Create a
parameter query that asks you for the location then create a report basedon
this query. When you run the report, it should ask you for the location. Put
something like below in the criteria of the "location" field of the query:

 [Enter the Location]

The [] are important. That's what makes Access ask you the question when the
query/report is run.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.



Bill Knott said:
I use a query to get info on any one of 70 locations that are in my
database. I create a simple reort with the info in the query grouping
it by date.
I know how to make the query ask for the location that I want info
on , is there away to use a report template, or a macro that produces
the same layout from the query withithout creating it manually over
and over again ?
Thanks for any insite that you can provide.- Hide quoted text -

- Show quoted text -

Thank You - now that you explained it, it seems logical .
 
Bill

An alternate approach to the one Jerry provided is to create a form on which
you have a combobox that lists all locations.  By selecting a location from
a list, you (or your users) don't have the ... 'opportunity' ... to enteran
invalid location.

Then modify your query to 'look at' the form's combobox to pick up the
parameter for that location's ID/name/whatever.

NOTE:  for the query to work, the form must be open and a location selected.

NOTE 2: base your report on your query.  "Order" your report by openingthe
form, selecting a location, and clicking on the new command button you added
<Order Report> (which opens the report).

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP






- Show quoted text -


Thanks for your help - I will try it tonight.
 
Back
Top