specifying quantity of report printouts with macro.

Kieran

Learn learn learn..Forget
Local time
Tomorrow, 08:50
Joined
Jul 16, 2002
Messages
23
I need to be able to print out a report, but i also need to be able to specify how many copies to print out. i have a form with a text box which i was hoping to be able to enter the number in that box, then using a macro use that number for the quantity of prints. Is this possible??
 
Use this code in the OnClick event of your print button...
Code:
Dim looptimes, count As Integer

    looptimes = InputBox("Enter a number of prints")
    For count = 1 To looptimes
    DoCmd.OpenReport "YourReportName", acNormal, ""
    Next count
HTH
 
Or if you want to use your Text Box...
Code:
Dim looptimes, count As Integer

    looptimes = Me.YourTextBox
    For count = 1 To looptimes
    DoCmd.OpenReport "YourReportName", acNormal, ""
    Next count

HTH
 
Instead of using the loop...why not use the printout method

Place this in a command button code to fire the opening of the desired report:

DoCmd.OpenReport "YourReportName", acNormal, ""

Then in your report activate event have

DoCmd.PrintOut ,,,,Forms!FormName!TextBoxName


Hope this helps,
CT
 
Last edited:

Users who are viewing this thread

Back
Top Bottom