Newbie Question

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
 
F

fredg

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.
 

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