[AccessD] One report using alternate sources

Heenan, Lambert Lambert.Heenan at AIG.com
Mon Apr 11 12:38:49 CDT 2005


Sure can.  Design you single, master report, and all the various versions of
the query needed to select the subsets of results. Then bind the report to a
copy of one of the queries. You could name the query copy "FinalOutPut_qry",
or whatever.

Then, when you want to run any one version of the report, your code will
check which version of the query is needed and then use...

DoCmd.CopyObject ,"FinalOutput_qry",acQuery,
"NameOfTheQueryThatSelectsWhatYouWant"

i.e. you copy the query that select the records you need to the 'disposable'
query named ,"FinalOutput_qry", or whatever, to which the report is bound.
The nice thing about this is that it works for MDE as well as MDB files.

Lambert

> -----Original Message-----
> From:	accessd-bounces at databaseadvisors.com
> [SMTP:accessd-bounces at databaseadvisors.com] On Behalf Of John Clark
> Sent:	Monday, April 11, 2005 12:52 PM
> To:	accessd at databaseadvisors.com
> Subject:	[AccessD] One report using alternate sources
> 
> I've got this program (A2K) that tracks many of the various programs,
> and subsequent "sub-programs," that are provided by our Office for the
> Aging department. I have recently been asked to add about 8 or 9 reports
> to the program. The reports for these programs are identical to one
> another except for a single criteria (i.e. they all have name, address,
> age, etc., but one may be specifically for "prog A" and another "prog
> B"). I went ahead and whipped up 9 very similar queries and it occurred
> to me, because the form is starting to get crowded w/buttons, that there
> may be a way to put these together somehow. I have created an option
> group, which lists the programs, but now I would like to click on a
> button that runs a report based on the option group choice. I know I can
> do this, by calling different reports, but is there a way to actually
> create one single report that uses the different queries based on this
> same option choice?
> 
> Thanks,
> 
> John W Clark
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com



More information about the AccessD mailing list