How to close the POS report automatically if the print failed
I want the Point of sales report to close automatically either after printing or if it failed to print , how do I do it , please do not worry about the the attached action queries they are there to handle the double entry only , below is my VBA code:
Private Sub CmdPos_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery "QryRevenueAccount"
DoCmd.OpenQuery "QryCostofSales"
DoCmd.OpenQuery "QryStockAccount"
DoCmd.OpenQuery "QryVatAccount"
DoCmd.OpenQuery "QryReceiptsAcc"
DoCmd.Save
DoCmd.OpenReport "rptPosReceipts", acViewPreview, , "ItemSoldID =" & Me.ItemSoldID
DoCmd.PrintOut , , , , 1
DoCmd.Close acReport, "rptPosReceipts"
Me.Refresh
End Sub
See how the above code can be amended.
Regards
Chris
Private Sub CmdPos_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery "QryRevenueAccount"
DoCmd.OpenQuery "QryCostofSales"
DoCmd.OpenQuery "QryStockAccount"
DoCmd.OpenQuery "QryVatAccount"
DoCmd.OpenQuery "QryReceiptsAcc"
DoCmd.Save
DoCmd.OpenReport "rptPosReceipts", acViewPreview, , "ItemSoldID =" & Me.ItemSoldID
DoCmd.PrintOut , , , , 1
DoCmd.Close acReport, "rptPosReceipts"
Me.Refresh
End Sub
See how the above code can be amended.
Regards
Chris
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.