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

Reports need printed multiple times

Status
Not open for further replies.

EllieFant

MIS
May 15, 2001
513
US
I have a database where I have the following code that asks me how many copies of the report I want to print.

Private Sub Report_Activate()
Dim intNum As Variant

intNum = Val(InputBox("How many copies?"))

If intNum = 0 Then
Exit Sub
Else
DoCmd.PrintOut , , , , intNum
End If
End Sub

This works wonderfully. My question is this. How can I apply the same idea to print multiple reports. I currently have this code behind a button that prints multiple reports:

DoCmd.OpenReport "PRPStatus", acNormal, "", ""
DoCmd.OpenReport "PRPOverview", acNormal, "", ""
DoCmd.OpenReport "ShiftStatusPRP", acNormal, "", ""
DoCmd.OpenReport "rptIncompleteNACReqs", acNormal, "", ""
DoCmd.OpenReport "rptTrainingDue", acNormal, "", ""

I need to print this set of reports for 7 different people (I want to enter the number of copies of reports to print cause like all things - the number of reports I need to print changes).

How do I combine these two ideas into one button click? I am needing to do this by the click of a button so that anyone in our office can do it without having to know exactly what reports (out of the 20+ we have) need to be printed.

Thanks many times over!


Ellie
**Using Access 97 at work**
**Using Access 2000 at home**

elliefant@qwest.net
 
You could set up a loop:
Dim intNum As Variant
Dim intCopy as Integer
intNum = Val(InputBox("How many copies?"))
If intNum = 0 Then
Exit Sub
Else
For intCopy = 1 to intNum
DoCmd.OpenReport "PRPStatus", acNormal
DoCmd.OpenReport "PRPOverview", acNormal
DoCmd.OpenReport "ShiftStatusPRP", acNormal
DoCmd.OpenReport "rptIncompleteNACReqs", acNormal
DoCmd.OpenReport "rptTrainingDue", acNormal
Next
End If
End Sub


Duane
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top