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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reports Bound to Parameter query

Status
Not open for further replies.

Crowley16

Technical User
Jan 21, 2004
6,931
GB
Hi...

I've got a parameter query, 2 parameters, and a report which is bound to this.

I'm activating the report using a command button on a form, and 2 textboxes for the 2 parameters.

my question is, how do I "load" the parameters into the query when I click on the command button, so it doesn't ask me for the parameters?

Thanks

--------------------
Procrastinate Now!
 
If your query contains the parameters, it should normally work, unless you're closing the form when you open the report. If so, just alter the visible property of the form (false) when you issue the openreport method, and either set the visible property to true when closing the report, or close the form then. The form needs to be open for the query to read the parameters. If this is not the issue, I think we need more details...

Roy-Vidar
 
Oops...

let me clarify...

I'm using the parameters as [StDate?] in the query, but the actual textbox name is Forms!Reports!StartDate

I just didn't want to have to type in the long thing about 9 times in the query.

At the moment, this method opens a popup whenever I open the query/report, however I want to "load" the textbox values to the parameters onOpen of report instead of having popup input boxes...

Does that make sense?

--------------------
Procrastinate Now!
 
I think you'll need to either copy/paste the reference to all 9 places, or create a public function to retrieve the text control. I don't know of a way of "alias" parameters like this in ordinary stored queries. You could assign a sql as recordsource in the reports on open, referencing the control, but that wouldn't create less typing...

Roy-Vidar
 
Oh, well, nevermind... Thanks for the help...

I was just thinking that there might have been some way to dynamically set the parameters on a stored query, and have a report bounded to it, that way, I could probably point the parameters to different textboxes and different forms and stuff...



--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top