Setting parameters in code for query underlying report

DaveJHPT

Registered User.
Local time
Today, 10:12
Joined
Mar 17, 2005
Messages
64
How can I set the parameters for a query underlying a report before running the report from code? I've successfully used the Parameters collection of the QueryDef to set the parameters before running a query from code, but the same approach doesn't appear to work for reports, and the report prompts for the parameters for the underlying query.

The reports are called from various different forms so I specifically want to avoid hard-coding the name of a form control into the report/query.

[I can't believe nobody has asked this before, but I can't find a thread that covers it. Apologies if appropriate.]

Thanks in advance

Dave
 
Just a thought since no others have replied - Consider removing the changable parameters from the underlying query altogether and apply your unique parameters using the [wherecondition] on the Openreport command.
 
Yep, I guess that would do it!

Thanks

Dave
 

Users who are viewing this thread

Back
Top Bottom