By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,661 Members | 1,808 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,661 IT Pros & Developers. It's quick & easy.

Report record source

P: n/a
Hi

Is it possible to change the record source query of a report at runtime via
code so the report can work with different data source queries?

Thanks

Regards
Feb 19 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Sure. In the report's Open event, set its RowSource to whatever you want.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi

Is it possible to change the record source query of a report at runtime
via code so the report can work with different data source queries?

Thanks

Regards

Feb 19 '06 #2

P: n/a
If I am opening the report using OpenReport, how can I pass it the name of
query to open in Open event?

Thanks

Regards

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:eA****************@TK2MSFTNGP15.phx.gbl...
Sure. In the report's Open event, set its RowSource to whatever you want.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi

Is it possible to change the record source query of a report at runtime
via code so the report can work with different data source queries?

Thanks

Regards


Feb 19 '06 #3

P: n/a
if you're running A2K2 or later, you can use OpenArgs. otherwise you'll
have to monkey around with the 3rd and 4th arguments of the OpenReport
method (FilterName and WhereCondition).

Feb 19 '06 #4

P: n/a
I am using a2k. Any example of using FilterName or WhereCondition for this
purpose?

Thanks

Regards

"Jamey Shuemaker" <ca*********@yahoo.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
if you're running A2K2 or later, you can use OpenArgs. otherwise you'll
have to monkey around with the 3rd and 4th arguments of the OpenReport
method (FilterName and WhereCondition).

Feb 19 '06 #5

P: n/a
I handle this by setting the report's record source to qtempQuery and then
creating the appropriate qtempQuery just before opening the report.

HTH,
UpRider

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi

Is it possible to change the record source query of a report at runtime
via code so the report can work with different data source queries?

Thanks

Regards

Feb 19 '06 #6

P: n/a
Neither FilterName nor WhereCondition would be appropriate for that.

You could use UpRider's suggestion, or you could use a global variable that
you use in the Open event.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:Do******************************@pipex.net...
I am using a2k. Any example of using FilterName or WhereCondition for this
purpose?

Thanks

Regards

"Jamey Shuemaker" <ca*********@yahoo.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
if you're running A2K2 or later, you can use OpenArgs. otherwise you'll
have to monkey around with the 3rd and 4th arguments of the OpenReport
method (FilterName and WhereCondition).


Feb 20 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.