Solved DoCmd.PrintOut not printing correct quantity (1 Viewer)

Poco_90

Registered User.
Local time
Today, 07:14
Joined
Jul 26, 2013
Messages
87
Hi,
Hope someone can point me in the right direction. having trouble coding.

Have a text box on a form (txtNoLabels) that determines the no of copies of a report to print. The problem is I cannot get the report to print out the number of desired times using DoCmd.PrintOut

Even if I replace txtNoLabel with a numeric value it doesn't print the desired number of pages. Have tried different permutations/arguments of DoCmd.PrintOut, declaring variables etc etc.

I can't figure out what I am missing. Below are some permutations I tried.

Code:
DoCmd.OpenReport "rptLabel", acViewPreview, "", "", acNormal
                    MsgBox ("Label Qty " & txtNoLabel), vbInformation
                    'DoCmd.PrintOut , , , , txtNoLabel
                    'DoCmd.PrintOut acPrintAll, , , , txtNoLabel
                    'DoCmd.PrintOut acPages, , , , Me.txtNoLabel
                    'DoCmd.PrintOut acPrintAll, , , , intCopies
                    'DoCmd.PrintOut acPrintAll, , , , copies:=intCopies

                    'DoCmd.PrintOut , , , , 2
                    DoCmd.PrintOut , , , , [Forms]![frmLabel]![txtNoLabel].Value


Can anyone se where I am falling down? Thanks in advance.
Poco
 

Poco_90

Registered User.
Local time
Today, 07:14
Joined
Jul 26, 2013
Messages
87
Thanks for getting back to me. Still couldn't get it to work.

Ended up using a loop.

Do Until intPrint = Me.txtNoLabel
DoCmd.OpenReport "rptCard", acViewNormal
intPrint = intPrint + 1
Loop
 

Users who are viewing this thread

Top Bottom