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.