Selecting a Start and End Date on a Form to Get to a Report

C

Conor

I am working in Access 2007 and I am having trouble with entering a Start
Date and End Date in the Form then using a command button to go to a Report
with all the dates in between the Start and End Date. I know that a macro can
be used for this but I just can't get the Code right. Any Suggestions?

Thanks
 
S

Steve Schapel

Conor,

In the Criteria of the date field in the query that the report is based on,
put like this:
Between [Forms]![NameOfForm]![Start Date] And [Forms]![NameOfForm]![End
Date]
 
C

Conor

I have done this in a query already but I would like to use a form so anyone
can enter in two different dates into a two different text boxes and then
click a button and have it go to a report with those dates. Is there a way to
do this in a form?

Thanks



Steve Schapel said:
Conor,

In the Criteria of the date field in the query that the report is based on,
put like this:
Between [Forms]![NameOfForm]![Start Date] And [Forms]![NameOfForm]![End
Date]

--
Steve Schapel, Microsoft Access MVP


Conor said:
I am working in Access 2007 and I am having trouble with entering a Start
Date and End Date in the Form then using a command button to go to a
Report
with all the dates in between the Start and End Date. I know that a macro
can
be used for this but I just can't get the Code right. Any Suggestions?

Thanks
 
S

Steve Schapel

Conor,

Sorry, I am not sure I understand. That is exactly what I showed you.
Enter the dates into the two textboxes on the form, reference these
textboxes in the query criteria like I showed, and base the report on the
query. Open the report, and the data it shows will automatically be
filtered by the date range specified.
 
C

Conor

Thanks that worked, sorry i just misunderstood the first message. I have one
more question. On the form I have a third field that tracks errors. Is there
a way that I can put in the start date and end date and also enter the error
text into the error box and have a report that is sorted by start date, end
date, and error.

Thanks
 

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