Printing problems

TechRazor

Newbie
Local time
Today, 13:56
Joined
Sep 24, 2004
Messages
3
Hello All, I am just getting into VB and Access. At my work we are using Access 2003 for our database. All of our invoices and Purchase Orders are printed on 3 colors of paper: white, tan, and pink. Since their are different colors we print three copies of everything, one for customers, one for corporate, and one for us to file away. What my problem is that on Purchase Orders I need them to print out like this: page 1, pg 1, pg 1, pg 2, pg 2, pg 2, and so on in order for the colors to work. Right now it prints pg 1, pg 2, pg 3, pg 1, pg 2......This is the code that I am using for printing it. Thanks for the help. Also I have tried collate at True and False with no help.

Code:
Private Sub cmdReport_Click()
On Error GoTo Err_cmdReport_Click

    CalculateTotals
    Dim stDocName As String
    Dim Response
    Response = MsgBox("Are you sure?", vbYesNo)
    If Response = vbYes Then    ' User chose Yes.
        
        ''Get next new PO Number from POHeader table.
        If Me.PONum = 0 Then
            Dim rst As New ADODB.Recordset
            Dim SQL
            Dim MaxNo As Integer
            SQL = "Select Max(PONum) as Maxnumber from POHeader"
            rst.Open SQL, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
            If rst.EOF Then
                MaxNo = 0
            Else
                MaxNo = rst!maxnumber
            End If
            rst.Close
            Me.PONum = MaxNo + 1
        End If
        Me.PODate = Date
        Me.Refresh
        InsertExtraRecords      'Done for printing blank boxes.
        stDocName = "rptPurchaseOrder"
        
        Dim NumCopies As Integer
        NumCopies = 3
        
        DoCmd.OpenReport "rptPurchaseOrder", acViewPreview, "qryPurchaseOrderReport"
        DoCmd.SelectObject acReport, "rptPurchaseOrder"
        DoCmd.PrintOut acPrintAll, , , , NumCopies, True
        DoCmd.Close acReport, "rptPurchaseOrder"
        
        DoCmd.SetWarnings False
        DoCmd.OpenQuery "qryPODetailPrintDelete", , acAdd
        DoCmd.SetWarnings True
        
        DoCmd.Close
        Forms!PurchaseOrderDesk.Form.SetFocus
        DoCmd.Restore
    
    End If

Exit_cmdReport_Click:
    Exit Sub

Err_cmdReport_Click:
    MsgBox Err.Description
    Resume Exit_cmdReport_Click
    
End Sub
 
It probably is a printer setting but I don't know what code to use to fix it because I do not want to have user interaction required
 

Users who are viewing this thread

Back
Top Bottom