Newbie Question

  • Thread starter Thread starter DavidW
  • Start date Start date
D

DavidW

This is my first time with reports
How or can you have a way to set what month a report is to be printed from?
I got the form to look like what I want but how can you have a way like a
combobox, etc. to set what month and year to use on a specific report?
Thanks David
 
DavidW said:
This is my first time with reports
How or can you have a way to set what month a report is to be printed from?
I got the form to look like what I want but how can you have a way like a
combobox, etc. to set what month and year to use on a specific report?
Thanks David

You did write "is to be printed from"!!

David,
Add an unbound control to the form.
Set it's format to Short Date.
Name it txtDate.

Add a Command button to the form.

Code it's Click event:
DoCmd.OpenReport "ReportName", acViewPreview, , "[DateField] >= #" &
Me!txtDate & "#"

Enter a valid date, using m/d/yyyy, in the txtDate control.

The above will print all records from the date entered onward.
You can change the >= to any other operator needed.
 
Back
Top