Too many queries

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hello.

I want to create a number of reports that will be based on
queries that are somewhat similar.

For example, "Report 1" will be based on a query that
shows all the records of GroupA "Report 2" will show a
certain critera of GroupA and "Report 3" will show yet
another critera of GroupA. I know that I can make 3
separate queries per group to do this, however, I have 13
separate groups, each with the option to print 3 types of
reports and I don't want to have to make 39 separate
queries.

Is there a way to have 3 reports based on 1 query but have
the criteria change for each one?

Hope this makes SOME sence.

Any assistance would be greatly appreciated.

m.
 
When you launch the report using the DoCmd.OpenReport you can
pass a WHERE criteria clause. So, you could use the same query
for each one, but put something like this in the DoCmd call ...

DoCmd.OpenReport "myReport" , , , , "[CustID]=" & Me.CustID

I may have the wrong number of commas above, but you get the idea.
 
Thank you very much for the quick response.

I understand what you are saying, but unfortunelty, my VBA
skills leave much to be desired and I am not sure of the
correct syntax to use.

So how would I tell it, in VBA, to open
report "rptMyReport" who's control source is "qryMembers"
and to have the following criteria?

qryMembers
----------
Field: AgencyName Group
Table: Agency MainTable
Criteria: Government Transportation

Once again, thanks for your assistance.

m.
-----Original Message-----
When you launch the report using the DoCmd.OpenReport you can
pass a WHERE criteria clause. So, you could use the same query
for each one, but put something like this in the DoCmd call ...

DoCmd.OpenReport "myReport" , , , , "[CustID]=" & Me.CustID

I may have the wrong number of commas above, but you get the idea.
--

Danny J. Lesandrini
(e-mail address removed)
http://amazecreations.com/datafast


Mike said:
Hello.

I want to create a number of reports that will be based on
queries that are somewhat similar.

For example, "Report 1" will be based on a query that
shows all the records of GroupA "Report 2" will show a
certain critera of GroupA and "Report 3" will show yet
another critera of GroupA. I know that I can make 3
separate queries per group to do this, however, I have 13
separate groups, each with the option to print 3 types of
reports and I don't want to have to make 39 separate
queries.

Is there a way to have 3 reports based on 1 query but have
the criteria change for each one?

Hope this makes SOME sence.

Any assistance would be greatly appreciated.

m.


.
 
Sounds to me like it would be simpler to use a parameter
query.

In your query type in parameter prompts in the Criteria
section. When you run the query (or the report) you will
be prompted to enter the criteria. Note the input in the
criteria field needs to be bracketed, eg [Enter the group
to report on].

Hope this helps.

-----Original Message-----
Thank you very much for the quick response.

I understand what you are saying, but unfortunelty, my VBA
skills leave much to be desired and I am not sure of the
correct syntax to use.

So how would I tell it, in VBA, to open
report "rptMyReport" who's control source is "qryMembers"
and to have the following criteria?

qryMembers
----------
Field: AgencyName Group
Table: Agency MainTable
Criteria: Government Transportation

Once again, thanks for your assistance.

m.
-----Original Message-----
When you launch the report using the DoCmd.OpenReport
you
can
pass a WHERE criteria clause. So, you could use the
same
query
for each one, but put something like this in the DoCmd call ...

DoCmd.OpenReport "myReport" , , , , "[CustID]=" & Me.CustID

I may have the wrong number of commas above, but you get the idea.
--

Danny J. Lesandrini
(e-mail address removed)
http://amazecreations.com/datafast


Mike said:
Hello.

I want to create a number of reports that will be
based
.
 
Back
Top