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

Sending Parameters to Query

P: n/a
For a query that has two parameters for a start and end date, is it
possible to send the parameters values when the query is used by a
report instead of prompting the user?
I do not want to add the [forms]![myform]![mycontrol] in to the query
as it then makes the query useable from only that one form.

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Well there are options of course.
<Battens down the hatches>

You *could* use global variables and have a function pull the value as the
criteria for your query (wherever it may be opened from). (Not particularly
my preference I hasten to add)

Or perhaps just have a local table that holds criteria for you (dates too
and other criteria ranges perhaps) and retrieve those values in your WHERE
clause. Set those values before opening whatever form or report you wish
and yer off.

Any use?

<ro*******@hotmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
For a query that has two parameters for a start and end date, is it
possible to send the parameters values when the query is used by a
report instead of prompting the user?
I do not want to add the [forms]![myform]![mycontrol] in to the query
as it then makes the query useable from only that one form.

Nov 13 '05 #2

P: n/a
<ro*******@hotmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
For a query that has two parameters for a start and end date, is it
possible to send the parameters values when the query is used by a
report instead of prompting the user?
I do not want to add the [forms]![myform]![mycontrol] in to the query
as it then makes the query useable from only that one form.

Have you looked at the arguments for DoCmd.OpenReport? You can specify a
filter so it only shows relavant records. This is OK as long as you provide
your users forms and buttons to open the report and do not simply let them
open it from the database window.
Another option is to base the report on a query and re-write the definition
of the query (qdf.SQL) each time. Again - this is for when you write the
UI.
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.