• Print Command (Access 2000)

    Author
    Topic
    #363841

    I have a function that prints an invoice and makes some controls visible on the report.However,when the function preforms its action
    the invisible controls are not seen on the screen, although they are printed.
    On the other hand,if i only the ppreview the report, with no printing, all is seen on the screen

    My function is the following:
    Dim stLinkCriteria As String
    Dim stDocName As String
    stLinkCriteria = “orderid = ” & OrderID
    stDocName = “Invoice”
    DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
    Reports![invoice]![TxtOrderNumber].Visible = True
    Reports![invoice]![txtOrderDate].Visible = True
    Reports![invoice]![original].Visible = False
    Reports![invoice]![TxtInvoiceNumber].Visible = False
    Reports![invoice]![TxtInvoiceDate].Visible = False
    DoCmd.printout acPages, 1, 1, acLow, 1, True

    When i use the above function, the invoice is printed all right,but the visible controls for TxtOrderNumber and TxtOrderDate
    are not seen on the screen.

    On the other hand if i preview the report only,everything is on the screen, as with the following modification,that
    is without the print command:

    Dim stLinkCriteria As String
    Dim stDocName As String
    stLinkCriteria = “orderid = ” & OrderID
    stDocName = “Invoice”
    DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
    Reports![invoice]![TxtOrderNumber].Visible = True
    Reports![invoice]![txtOrderDate].Visible = True
    Reports![invoice]![original].Visible = False
    Reports![invoice]![TxtInvoiceNumber].Visible = False
    Reports![invoice]![TxtInvoiceDate].Visible = False
    Thats it,without the command DoCmd.printout acPages, 1, 1, acLow, 1, True.

    So once again, my function works all right,i can print perfect invoices with it, i only want to
    imporve it, and it will be more handy if the the user sees on the screen the right invoice,what really is.

    For me it is a great problem but i am sure i will receive an interesting solution.

    Viewing 0 reply threads
    Author
    Replies
    • #556597

      Aral,

      When I have to make controls visible or invisible, I always do it in the report itself. Depending on where the controls are or what the criteria to print or not is, I put the statements in the ON Open event of the report or in the On Format from the different section (derails, header, footers, …) of the report. See this post for a sample

    Viewing 0 reply threads
    Reply To: Print Command (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: