NYFashionToGo
Technical User
I have some code in an access module that I run from Excel.
It basically gets my items ready for shipping, Printing shipping labels and sales receipts.... Due to the nature of the way I need to print out shipping Labels. I had broken down the reports By = United States <> United States for printing.
Is there a way I can disable the report from printing if There are no results to print a report. The International doesnt happen every day, and I always get a blank sheet printing out..... How do I skip over it....
I tried to iscolate the part of the code below by creating large space between to show where the reports print from..
Option Compare Database
'------------------------------------------------------------
' Import_Sales_and_Payments_Info_Macro
'
'------------------------------------------------------------
Function Import_Sales_and_Payments_Info_Macro()
DoCmd.OpenQuery "Delete Orders Query", acViewNormal, acEdit
DoCmd.OpenQuery "DeleteOrderSummary Query", acViewNormal, acEdit
' Imports Customers
DoCmd.TransferText acImportDelim, "Customers Import Specification", "Customers", "C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\AccessImportprocessing\Customers.txt", True, ""
' Imports Orders
DoCmd.TransferText acImportDelim, "Orders Import Specification", "Orders", "C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\AccessImportProcessing\Orders.txt", True, ""
' Imports Orders Summaries
DoCmd.TransferText acImportDelim, "OrderSummary Import Specification", "OrderSummary", "C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\AccessImportProcessing\OrderSummary.txt", True, ""
' Imports PayPal DownLoad
DoCmd.TransferText acImportDelim, "PayPalDownload Import Specification", "PayPalDownload", "C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\AccessImportProcessing\PayPalDownload.txt", True, ""
' Imports updated Feedback Info
DoCmd.TransferText acImportDelim, "UpdateFeedBack Import Specification", "UpdateFeedBack", "C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\AccessImportProcessing\UpdateFeedBack.txt", True, ""
' Imports PayPals Echeck For Updates to Mark as Cleared
DoCmd.TransferText acImportDelim, "ECheckUpdate Import Specification", "ECheckUpdate", "C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\AccessImportProcessing\ECheckUpdate.txt", True, ""
' Updates Echecks From Pending To Cleared
DoCmd.OpenQuery "UpdateEcheckStatus", acViewNormal, acEdit
' Updates Paid Items Via Paypal and Marks Paid
DoCmd.OpenQuery "Update Mark Items As Paid", acViewNormal, acEdit
' ReturnQueryStep1
DoCmd.OpenQuery "ReturnRefundStep1Query", acViewNormal, acEdit
' ReturnQueryStep2
DoCmd.OpenQuery "ReturnRefundStep2Query", acViewNormal, acEdit
' ReturnQueryStep3
DoCmd.OpenQuery "ReturnRefundStep3Query", acViewNormal, acEdit
' ReturnQueryStep4
DoCmd.OpenQuery "ReturnRefundStep4Query", acViewNormal, acEdit
' Exports CSV Files For Shipping Labels
DoCmd.RunMacro "1 Output Shipping Labels Priority", , ""
DoCmd.OpenReport "Sales Receipt", acPrint, , "[Country]='United States'"
DoCmd.OpenReport "Sales Receipt", acPrint, , "[Country]<>'United States'"
Import_Sales_and_Payments_Info_Macro1_Exit:
Exit Function
Import_Sales_and_Payments_Info_Macro1_Err:
MsgBox Error$
Resume Import_Sales_and_Payments_Info_Macro1_Exit
End Function
It basically gets my items ready for shipping, Printing shipping labels and sales receipts.... Due to the nature of the way I need to print out shipping Labels. I had broken down the reports By = United States <> United States for printing.
Is there a way I can disable the report from printing if There are no results to print a report. The International doesnt happen every day, and I always get a blank sheet printing out..... How do I skip over it....
I tried to iscolate the part of the code below by creating large space between to show where the reports print from..
Option Compare Database
'------------------------------------------------------------
' Import_Sales_and_Payments_Info_Macro
'
'------------------------------------------------------------
Function Import_Sales_and_Payments_Info_Macro()
DoCmd.OpenQuery "Delete Orders Query", acViewNormal, acEdit
DoCmd.OpenQuery "DeleteOrderSummary Query", acViewNormal, acEdit
' Imports Customers
DoCmd.TransferText acImportDelim, "Customers Import Specification", "Customers", "C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\AccessImportprocessing\Customers.txt", True, ""
' Imports Orders
DoCmd.TransferText acImportDelim, "Orders Import Specification", "Orders", "C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\AccessImportProcessing\Orders.txt", True, ""
' Imports Orders Summaries
DoCmd.TransferText acImportDelim, "OrderSummary Import Specification", "OrderSummary", "C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\AccessImportProcessing\OrderSummary.txt", True, ""
' Imports PayPal DownLoad
DoCmd.TransferText acImportDelim, "PayPalDownload Import Specification", "PayPalDownload", "C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\AccessImportProcessing\PayPalDownload.txt", True, ""
' Imports updated Feedback Info
DoCmd.TransferText acImportDelim, "UpdateFeedBack Import Specification", "UpdateFeedBack", "C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\AccessImportProcessing\UpdateFeedBack.txt", True, ""
' Imports PayPals Echeck For Updates to Mark as Cleared
DoCmd.TransferText acImportDelim, "ECheckUpdate Import Specification", "ECheckUpdate", "C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\AccessImportProcessing\ECheckUpdate.txt", True, ""
' Updates Echecks From Pending To Cleared
DoCmd.OpenQuery "UpdateEcheckStatus", acViewNormal, acEdit
' Updates Paid Items Via Paypal and Marks Paid
DoCmd.OpenQuery "Update Mark Items As Paid", acViewNormal, acEdit
' ReturnQueryStep1
DoCmd.OpenQuery "ReturnRefundStep1Query", acViewNormal, acEdit
' ReturnQueryStep2
DoCmd.OpenQuery "ReturnRefundStep2Query", acViewNormal, acEdit
' ReturnQueryStep3
DoCmd.OpenQuery "ReturnRefundStep3Query", acViewNormal, acEdit
' ReturnQueryStep4
DoCmd.OpenQuery "ReturnRefundStep4Query", acViewNormal, acEdit
' Exports CSV Files For Shipping Labels
DoCmd.RunMacro "1 Output Shipping Labels Priority", , ""
DoCmd.OpenReport "Sales Receipt", acPrint, , "[Country]='United States'"
DoCmd.OpenReport "Sales Receipt", acPrint, , "[Country]<>'United States'"
Import_Sales_and_Payments_Info_Macro1_Exit:
Exit Function
Import_Sales_and_Payments_Info_Macro1_Err:
MsgBox Error$
Resume Import_Sales_and_Payments_Info_Macro1_Exit
End Function