Copying a Query

  • Thread starter Thread starter totalchaos1114
  • Start date Start date
T

totalchaos1114

Guest
I'm EXTREMELY new to Access. Basically, I have an existing query that I need to create different criteria on. I have copied the original query and then changed the criteria on the duplicate queries. However, it is not creating reports on them. Does the report attach to the original query only and therefore I am going to have to create whole new ones, or am I missing a step? Thanks for your help on this!! :)
 
In general, you should have a single report which uses a single query as its record source; the criteria (to limit the results displayed on the report) should be fed to the query when the report is launched.

For example:
Your query contains Field1, Field2, and Field 3
Your report is based on this query
To launch the report, you click a button on a form
The OnClick event of this button contains the command (see DoCmd.OpenReport in Access Help) to launch the report, one of the parameters of this command provides the "WHERE" clause for the query (e.g., Field1 = "apples" AND Field2 = "green")
You could allow the user to specify the parameters (perhaps by making combo or list box selections on the launching form), or you could hard code the parameters (perhaps having several buttons on the form, each launching the report with different parameters)
 
Just use the one query without criteria and use the Where clause of the Open Report method. In most cases you can use just one Report/query.
 

Users who are viewing this thread

Back
Top Bottom