Selecting a Date Range For a REport

G

Guest

I have been searching the Access Bible for hours trying to figure this out. I
want to have my office staff be able to print reports for any given time
period--usually for the month at the end of each month. I want it to be
simple and I want them to be able to select the dates preferrably with a drop
down calendar. I already have the report made. I just need to figure out how
to select the dates using a form or switchboard or something without haveing
to go in and edit the query or form.

I know this is simple, but I cannot seem to figure it out.

Thanks for the help.
 
J

Jeff Boyce

Assuming the report is based on a query (right?!), you could modify the
query's selection criteria to "point" to the form on which your users are
selecting dates (or other criteria).

They would look something like:

Forms!YourFormName!YourCriterionControlName

and if you wanted to get everything between two dates, use two controls on
the form, and the "Between ...And ..." expression in the criterion.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

That is great. I almost understand :)

My selection criteria in the query is "Between #10/1/2006# And #10/31/2006#"
and it works fine. I think you understand that I don't want my employees
screwing around with my queries. I want a form that they can enter the dates
in at the end of each month and print a report. I also think you understand
that as well. What I don't understand is what you mean by "point" and a
little more detail on how to do it. More help would be appreciated.

If you know a tutorial or where it is in the Access 2003 Bible please let me
know so you don't have to type it all out.

thanks again

Mark
 
J

John Spencer

Check out this article for a detailed discussion.
http://www.fontstuff.com/access/acctut08.htm


A brief quote from a John Vinson (Access MVP) posting.

You'll need to create a small unbound Form (let's call it frmCriteria) with
a Combo Box control (cboCrit) on it. Use the combo box wizard to select the
table for the selections, and be
sure that the bound field of the combo is the value you want to use as a
criterion. Save this form.

Now use

=[Forms]![frmCriteria]![cboCrit]

as the criterion in your Query.

It's convenient to base a second Form or Report on the resulting query to
display the results; if you put a button on frmCriteria to launch that form
or report, the user can enter the criterion and view the results in one
simple operation!

Quoting John Vinson

Keywords: Parameter Queries
 
G

Guest

Thanks John.

that is a big help.



John Spencer said:
Check out this article for a detailed discussion.
http://www.fontstuff.com/access/acctut08.htm


A brief quote from a John Vinson (Access MVP) posting.

You'll need to create a small unbound Form (let's call it frmCriteria) with
a Combo Box control (cboCrit) on it. Use the combo box wizard to select the
table for the selections, and be
sure that the bound field of the combo is the value you want to use as a
criterion. Save this form.

Now use

=[Forms]![frmCriteria]![cboCrit]

as the criterion in your Query.

It's convenient to base a second Form or Report on the resulting query to
display the results; if you put a button on frmCriteria to launch that form
or report, the user can enter the criterion and view the results in one
simple operation!

Quoting John Vinson

Keywords: Parameter Queries
joerocket said:
That is great. I almost understand :)

My selection criteria in the query is "Between #10/1/2006# And
#10/31/2006#"
and it works fine. I think you understand that I don't want my employees
screwing around with my queries. I want a form that they can enter the
dates
in at the end of each month and print a report. I also think you
understand
that as well. What I don't understand is what you mean by "point" and a
little more detail on how to do it. More help would be appreciated.

If you know a tutorial or where it is in the Access 2003 Bible please let
me
know so you don't have to type it all out.

thanks again

Mark
 
M

Mellstock

One simple thing you could do is in the query under you date field to
enter the criteria

Between Date() And Date() - 30

That will give you all the records in the thirty days leading up to
today's date at the touch of a button no need for staff to enter
parameters or see your programing and can be started from a
switchboard.
Thanks John.

that is a big help.



John Spencer said:
Check out this article for a detailed discussion.
http://www.fontstuff.com/access/acctut08.htm


A brief quote from a John Vinson (Access MVP) posting.

You'll need to create a small unbound Form (let's call it frmCriteria) with
a Combo Box control (cboCrit) on it. Use the combo box wizard to select the
table for the selections, and be
sure that the bound field of the combo is the value you want to use as a
criterion. Save this form.

Now use

=[Forms]![frmCriteria]![cboCrit]

as the criterion in your Query.

It's convenient to base a second Form or Report on the resulting query to
display the results; if you put a button on frmCriteria to launch that form
or report, the user can enter the criterion and view the results in one
simple operation!

Quoting John Vinson

Keywords: Parameter Queries
joerocket said:
That is great. I almost understand :)

My selection criteria in the query is "Between #10/1/2006# And
#10/31/2006#"
and it works fine. I think you understand that I don't want my employees
screwing around with my queries. I want a form that they can enter the
dates
in at the end of each month and print a report. I also think you
understand
that as well. What I don't understand is what you mean by "point" and a
little more detail on how to do it. More help would be appreciated.

If you know a tutorial or where it is in the Access 2003 Bible please let
me
know so you don't have to type it all out.

thanks again

Mark


:

Assuming the report is based on a query (right?!), you could modify the
query's selection criteria to "point" to the form on which your users are
selecting dates (or other criteria).

They would look something like:

Forms!YourFormName!YourCriterionControlName

and if you wanted to get everything between two dates, use two controls
on
the form, and the "Between ...And ..." expression in the criterion.

Regards

Jeff Boyce
Microsoft Office/Access MVP

I have been searching the Access Bible for hours trying to figure this
out.
I
want to have my office staff be able to print reports for any given
time
period--usually for the month at the end of each month. I want it to be
simple and I want them to be able to select the dates preferrably with
a
drop
down calendar. I already have the report made. I just need to figure
out
how
to select the dates using a form or switchboard or something without
haveing
to go in and edit the query or form.

I know this is simple, but I cannot seem to figure it out.

Thanks for the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top