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

  • Thread starter Thread starter Conor
  • Start date Start date
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
 
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]
 
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
 
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.
 
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
 
Back
Top