Report Design and Queries

  • Thread starter Thread starter sandra.coleman3
  • Start date Start date
S

sandra.coleman3

I have created one custom design for 6 reports.

Is there a way to attach that one design to 6 different
queries without having to re-create the same design in
each report.

If I do a "save as" option with original report and
design I get the wrong query results in new report.

Re-creating design is too tedious and time consuming....
Thanks for your help!!
 
Do all 6 queries have the same column names? Are they
based off of the same table or different tables?

If they have the same column names, you can create 6
reports, using copy and paste, then go into each report
and change the record source property to use the specified
query.

If all the queries are based off the same table, maybe you
can add an indicator to the query, in effect, grouping the
data, instead of having 6 queries. The report can then
break on this indicator, producing the results 6 times
from one report.

Hope I didn't totally misunderstand your question, and
that this might help.
 
I have created one custom design for 6 reports.

Is there a way to attach that one design to 6 different
queries without having to re-create the same design in
each report.


If you use a form where the users can specify the data
source for the report, then the report can use code in its
Open event to set its own query. For example, let's say the
form has 6 buttons, one for each data source and an unbound,
invisible text box named txtQuery. Then the code for each
button's Click event would look like:

Sub Button1_Click(
Me.txtQuery = "FirstQuery"
DoCmd.OpenReport "thereport"
End Sub

and the code in the report's Open event procedure would be:

Sub Report_Open(
Me.RecordSource = Forms!theform.txtQuery
End Sub

I think that answers your question, but I have to add that
this is an unusual thing to do. You never said why you need
to use 6 different queries, but if it's because you want to
filter report's data in different ways, there are much
better ways to do that.
 
-----Original Message-----
Do all 6 queries have the same column names?
yes
Are they based off of the same table or different tables?
Same table
If they have the same column names, you can create 6
reports, using copy and paste, then go into each report
and change the record source property to use the
specified >query.

How do I change the record source property
 
Back
Top