Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print according to two date fields! 2

Status
Not open for further replies.

abbottboi

IS-IT--Management
Nov 14, 2005
94
CA
Hi,

I have a small database with some donation information for a charity. I would need to print receipts for the donations using a report with the necessary information populated from the forms to show up in the report.

The question is, what would be the best way to set up the report so that i could entry a from and to date so that the report only picks up the records that haven't already been printed. Say, just records for the past two days. I do have a date field i could use as a perimeter.
Code:
receipt_date

many thanks
 
Setup a new form, with two text fields (txtStartDate, txtEndDate) and one button. The text fields are for entering your Start and End Dates. In the OnClick event of the button, use the following line of code...

Code:
DoCmd.OpenReport "ReportName", acViewPreview, , "[receipt_date] >= #" & Me.txtStartDate.Value & "# AND [receipt_date] <= #" & Me.txtEndDate.Value & "#"
 

Or in the query you have setup for your form, in the Criteria for your date field, type in:

Between [Type the beginning date:] And [Type the ending date:]

When you run the report, the underlying query will prompt you for a Start Date and an Ending Date and print out the report accordingly.

The Missinglinq

There's ALWAYS more than one way to skin a cat!
 
GREAT!

honestly, this forum never ceases to amaze me!

THANKS EVERYONE!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top