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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Between to Dates

Status
Not open for further replies.

MagnumVP

IS-IT--Management
Jul 9, 2002
109
US
I currently have a report that prints a single page for students to sign-in for a 5 day class.

The report has a [Start Date of the Class] and a [Sign-In date]. If the class is a 3 or 5 day class I would have to run this report 3 or 5 different times. On the report I currently have 2 parameters. 1) [Start Date of Class] 2) [Class Sign-In Date]. I have it formatted$ as Long Date.

What I want to do is leave the 1st parameter and have the 2nd parameter be the end date. Then have it print a Sign-In sheet for each day in between. This will allow me to type in two dates and have it print 3 or 5 different sign-in sheets for each day of the class.

Is this possible?

Any thougts would be great.

Magnum

 
Magnum, how are you running these reports. Are you running it from a button on a form or are you just opening the report, entering the parameters, and printing it? That will make a lot of difference.

Paul
 
The report is created by a query. It brings in the necessary fields and the report prints the sign-in sheet.

The report is run from the SwitchBoard. Once I click on "Print Sign-in Sheet" it runs a macro that opens that report. It asked me for two variables, 1)Start Date 2)End Date. Once I type those variables in, it prints the report.

The macro is structured as;
-Report Name=Sign In Sheet
-View=Print

I never see the report on the screen, it just print.

If I just go behind the switchboard into Reports and Click Sign-in Sheet, the two variable will popup but it will show me the report and not print it.

Can you help?

Thanks
 
This is going to be a little variation on a post CosmoKramer had the other day so he should get most of the credit (unless it doesn't work, then I'll take the blame). You will need to create a Table and two Queries to do this. I'm going to be fairly generic with my Naming conventions.

Table1 has one field in it called RecNum. You will add sequential numbers to this table, 1 thru 5 assuming 5 is the maximum number of pages you need printed. If you need more, add addtional numbers.

The first query, QueryA is the query your Report currently runs from. If it runs from a table, you will need to create a query from this table. Put your parameters in the date field like this (assuming you only have one date field),
Between [Enter Start Date] And [Enter End Date]

Add a new Field to this query that reads
MyCount:DateDiff("d",[Enter Start Date],[Enter End Date])

You can make the parameters in your Date field and the field MyCount anything you want, but, they need to match exactly.

Then create QueryB. Add QueryA and Table1. Do not join anything. Add all the Fields From QueryA and the single field from Table1. On the criteria line for the field RecNum from Table1 put
Between 1 and [MyCount]

When you run this query, it will return 3 or 5 identical records that can be sent to the Report to be printed.

Then change the Record Source for your Report to QueryB. When you press the button in your switchboard, you should have to enter the Dates, and then the Report should print the number of pages you need.

Sounds hard but really should be fairly straight forward. Give it a try and see how it goes.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top