Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One Parameter Feeding Multiple Queries on One Report 2

Status
Not open for further replies.

mclellan

Programmer
Aug 6, 2002
294
CA
Hello,

I have a report that has 4 graphs in it. Each graph pulls from a seperate query which prompts for a Site Name.

Can someone tell me how I can get the report to automatically feed the single input 'SiteName' into each of it's queries?

I was hoping there would be some way to have the report run a form, grab the users input, and then automatically feed that into the paramaters for each of the 4 different queries.

Thanks!
Barry
 
Here is the way I handle it.

1. Create a popup form with an unbound text box
2. Have an OK button that has a On Click Even that runs the report with the embedded graphs

3. Reference the unbound text box for the parameter of the graphs/report's underlying query

Each query should have a parameter something like this

[Forms]![frmPopUp]![Text2]

(form name and unbound field)

I would also add some code on the "OK" button to check for nulls and force the user back to the field to enter data.
 
also,

When the report opens

1. On Open Event of report........hide the popup form
2. On Close Event of report........close the popup form
 
I have a similar situation that I am trying to adapt my report to so I was hoping you could help with this. I have multiple queries in a report (through a sub-report) and I want to define the beginning and ending date for each query.

One way I was thinking about solving this is by creating an initial query which asks for beginning and ending data that all of the other queries are based upon. However, I would have to redo everything in order to do this. Any suggestions on how to keep the existing queries but still set the date parameters?

Thanks!
Mike
 
Its pretty similar to what I explained above except in the query grid you just put in your date field --

Between [Forms]![frmMyForm]![Text4] And [Forms]![frmMyform]![Text6]

Basically on your popup form [text4] is your beginning date and [text6] would be your ending date. Of course both fields are unbound and you can name them anything you like just put the appropriate label "beginning Date", "ending date", and make any name changes to the example listed above.
 
Knicks-thanks for your response. This is where I was getting a bit confused. Where do I actually enter:

Between [Forms]![frmMyForm]![Text4] And [Forms]![frmMyform]![Text6]

 
right on the criteria line of the queries for whatever field you use for date
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top