Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Print Command (Access 2000)

    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.

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print Command (Access 2000)

    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 <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showflat.pl?Cat=&Board=acc&Number=98334&page=0&vie w=expanded&sb=5&o=0&fpart=>this post</A> for a sample
    Francois

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •