Dear all,
Is it possible someone can have an idea how to call two functions immediately after successful printing of a receipt, the print function is stated below, and so once its run and the document comes out, I need to call the other two functions which links to two APIs to update inventory. If no data to print, then the calling of two functions must be aborted with the message "not data to print", Stock will not be updated!
The two functions should never be called if there is no data to print because at that point it means the system failed to generate the invoice detail meaning an error and so automatically it should abort.
Is it possible someone can have an idea how to call two functions immediately after successful printing of a receipt, the print function is stated below, and so once its run and the document comes out, I need to call the other two functions which links to two APIs to update inventory. If no data to print, then the calling of two functions must be aborted with the message "not data to print", Stock will not be updated!
Code:
DoCmd.OpenReport "RptPosReceipts", acViewPreview, "", "", acNormal
DoCmd.RunCommand acCmdPrint
Call CmdSalesQuantitesPOS_Click
Call CmdSavePosMasterQTY_Click
The two functions should never be called if there is no data to print because at that point it means the system failed to generate the invoice detail meaning an error and so automatically it should abort.