Link to home
Start Free TrialLog in
Avatar of Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScFlag for Zambia

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial