Specify parameter for database session

  • Thread starter Thread starter Sammy
  • Start date Start date
S

Sammy

How can I select all records after a certain date with
every query I run during a session? I have a menu form
where the user specifies the beginning date of all
queries. This date field is an unbound text box. Every
form and report accessed by the menu is based on various
parameter queries which ask what the start date is. How
can I pass this start date to all queries without using a
parameter query? The user needs to be able to change the
date only once on the menu form.
 
Sammy,
There's many ways to do this, so I'll go with a very "meat and potatoes"
solution.
I'd create a table with only one record. That record would have only a
Date field (ex. name = [DateCriteria]). A user could update that
DateCriteria at the beginning of a session, and from then on, your
forms/queries/reports could use that single DateCriteria value as a "global"
filter..
At any time, the user could change the Date, and then continue on with
that new criteria. Or you could work with one Date criteria for as long as
you'd like.
hth
Al Camp
 
OK, that makes sense. Do I add the filter to every
query? How do I add the filter to my queries? I tried
the following criteria on the date field in a query:
=>[DonationYear]![DateCriteria] and it still treats it as
a parameter query.
Thanks.
Sammy
-----Original Message-----
Sammy,
There's many ways to do this, so I'll go with a very "meat and potatoes"
solution.
I'd create a table with only one record. That record would have only a
Date field (ex. name = [DateCriteria]). A user could update that
DateCriteria at the beginning of a session, and from then on, your
forms/queries/reports could use that single DateCriteria value as a "global"
filter..
At any time, the user could change the Date, and then continue on with
that new criteria. Or you could work with one Date criteria for as long as
you'd like.
hth
Al Camp

How can I select all records after a certain date with
every query I run during a session? I have a menu form
where the user specifies the beginning date of all
queries. This date field is an unbound text box. Every
form and report accessed by the menu is based on various
parameter queries which ask what the start date is. How
can I pass this start date to all queries without using a
parameter query? The user needs to be able to change the
date only once on the menu form.


.
 
How can I select all records after a certain date with
OK, that makes sense. Do I add the filter to every
query?

Yes, that's what you originally specified.

Use this criteria (use your own names)
DMin("[DateCriteria]","tblYourDateCriteriaTable")

hth
Al Camp

Sammy said:
OK, that makes sense. Do I add the filter to every
query? How do I add the filter to my queries? I tried
the following criteria on the date field in a query:
=>[DonationYear]![DateCriteria] and it still treats it as
a parameter query.
Thanks.
Sammy
-----Original Message-----
Sammy,
There's many ways to do this, so I'll go with a very "meat and potatoes"
solution.
I'd create a table with only one record. That record would have only a
Date field (ex. name = [DateCriteria]). A user could update that
DateCriteria at the beginning of a session, and from then on, your
forms/queries/reports could use that single DateCriteria value as a "global"
filter..
At any time, the user could change the Date, and then continue on with
that new criteria. Or you could work with one Date criteria for as long as
you'd like.
hth
Al Camp

How can I select all records after a certain date with
every query I run during a session? I have a menu form
where the user specifies the beginning date of all
queries. This date field is an unbound text box. Every
form and report accessed by the menu is based on various
parameter queries which ask what the start date is. How
can I pass this start date to all queries without using a
parameter query? The user needs to be able to change the
date only once on the menu form.


.
 
Thank you, Al! It works great. Now one more question:
I want to put that same date on some reports. What do I
set the control of my text box to?
Thanks.
Sammy
-----Original Message-----
OK, that makes sense. Do I add the filter to every
query?

Yes, that's what you originally specified.

Use this criteria (use your own names)
DMin("[DateCriteria]","tblYourDateCriteriaTable")

hth
Al Camp

OK, that makes sense. Do I add the filter to every
query? How do I add the filter to my queries? I tried
the following criteria on the date field in a query:
=>[DonationYear]![DateCriteria] and it still treats it as
a parameter query.
Thanks.
Sammy
-----Original Message-----
Sammy,
There's many ways to do this, so I'll go with a very "meat and potatoes"
solution.
I'd create a table with only one record. That
record
would have only a
Date field (ex. name = [DateCriteria]). A user could update that
DateCriteria at the beginning of a session, and from then on, your
forms/queries/reports could use that single
DateCriteria
value as a "global"
filter..
At any time, the user could change the Date, and
then
continue on with
that new criteria. Or you could work with one Date criteria for as long as
you'd like.
hth
Al Camp

How can I select all records after a certain date with
every query I run during a session? I have a menu form
where the user specifies the beginning date of all
queries. This date field is an unbound text box. Every
form and report accessed by the menu is based on various
parameter queries which ask what the start date is. How
can I pass this start date to all queries without using a
parameter query? The user needs to be able to
change
the
date only once on the menu form.


.


.
 
=DMin("[DateCriteria]","tblYourDateCriteriaTable")
Al Camp

Sammy said:
Thank you, Al! It works great. Now one more question:
I want to put that same date on some reports. What do I
set the control of my text box to?
Thanks.
Sammy
-----Original Message-----
How can I select all records after a certain date with
every query I run during a session?
OK, that makes sense. Do I add the filter to every
query?

Yes, that's what you originally specified.

Use this criteria (use your own names)
DMin("[DateCriteria]","tblYourDateCriteriaTable")

hth
Al Camp

OK, that makes sense. Do I add the filter to every
query? How do I add the filter to my queries? I tried
the following criteria on the date field in a query:
=>[DonationYear]![DateCriteria] and it still treats it as
a parameter query.
Thanks.
Sammy
-----Original Message-----
Sammy,
There's many ways to do this, so I'll go with a
very "meat and potatoes"
solution.
I'd create a table with only one record. That record
would have only a
Date field (ex. name = [DateCriteria]). A user could
update that
DateCriteria at the beginning of a session, and from
then on, your
forms/queries/reports could use that single DateCriteria
value as a "global"
filter..
At any time, the user could change the Date, and then
continue on with
that new criteria. Or you could work with one Date
criteria for as long as
you'd like.
hth
Al Camp

message
How can I select all records after a certain date with
every query I run during a session? I have a menu form
where the user specifies the beginning date of all
queries. This date field is an unbound text box.
Every
form and report accessed by the menu is based on
various
parameter queries which ask what the start date is.
How
can I pass this start date to all queries without
using a
parameter query? The user needs to be able to change
the
date only once on the menu form.


.


.
 
Back
Top