Sorting Reports

  • Thread starter Thread starter Charles Houk
  • Start date Start date
C

Charles Houk

I am having problems figuring out how to show a report of
a limited amount of data in my main table. Essentially
what I want to do is Enter a date range and have only the
data that falls within that range in my table appear in
that report. Any help that could be offered would be
greatly appreciated
 
Charles Houk said:
I am having problems figuring out how to show a report of
a limited amount of data in my main table. Essentially
what I want to do is Enter a date range and have only the
data that falls within that range in my table appear in
that report. Any help that could be offered would be
greatly appreciated

Here is the basic syntax...

DoCmd.OpenReport "ReportName",,,"[DateField] BETWEEN #SomeDate# AND #SomeOtherDate#"

[DateField] would be the name of the date field included in the report. The two
dates that define the range can either be hard-coded into the command or they can be
pulled from a reference to a control on the current form as in...

DoCmd.OpenReport "ReportName",,,"[DateField] BETWEEN #" & Me!StartDate & "# AND #" &
Me!EndDate & "#"

If your DateField includes time you will likely need to add a day to the second
argument to get those records.
 
Back
Top