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.OpenReport "rptPosReceipts", acViewPreview, , "ItemSoldID =" & Me.ItemSoldID
DoCmd.PrintOut , , , , 1
DoCmd.Close acReport, "rptPosReceipts"
See how the above code can be amended.