Nittylions
Registered User.
- Local time
- Today, 17:10
- Joined
- May 9, 2006
- Messages
- 15
I'm t rying to export multiple spreadsheets and reports using a module. When i run the code i get the following error: "RUN TIME ERROR '2046'
The Command or acction 'OutputTo' isn't available now
It works fine until it gets to section highlighted in blue. If i remove that piece of the code then the next line i get the same error.
Here is the code that i'm currently trying to use. PLEASE HELP SOMEONE
The Command or acction 'OutputTo' isn't available now
It works fine until it gets to section highlighted in blue. If i remove that piece of the code then the next line i get the same error.
Here is the code that i'm currently trying to use. PLEASE HELP SOMEONE
Code:
Function BatchReports()
Call RunBatchReports
End Function
Sub RunBatchReports()
DoEvents
DoCmd.RunMacro "02_01_DOC_Inventory_Aging"
DoCmd.OutputTo acOutputQuery, "02_04_DOC_Inventory_Aging", "Microsoft Excel (*.xls)", "\\lobot\corp\in-house-custodian\dc_output\Inventory_Aging_Data\DOC_Data" & Format(Date, "yyyymmdd") & ".xls", False, "", 0
[COLOR="Blue"]DoCmd.OutputTo acOutputQuery, "01_03_Location_Aging", "Microsoft Excel (*.xls)", "\\lobot\corp\in-house-custodian\dc_output\Inventory_Aging_Data\CTD_Data" & Format(Date, "yyyymmdd") & ".xls", False, "", 0[/COLOR]
DoCmd.OutputTo acReport, "Audit_CTD_Aging", "SnapshotFormat(*.snp)", "\\lobot\corp\in-house-custodian\dc_output\Management_REPORTS\Audit_CTD_Aging" & Format(Date, "yyyymmdd") & ".snp", False, "", 0
DoCmd.OutputTo acReport, "Audit_DOC_Aging", "SnapshotFormat(*.snp)", "\\lobot\corp\in-house-custodian\dc_output\Management_REPORTS\Audit_DOC_Aging" & Format(Date, "yyyymmdd") & ".snp", False, "", 0
DoCmd.OutputTo acReport, "Mailroom_CTD_Aging", "SnapshotFormat(*.snp)", "\\lobot\corp\in-house-custodian\dc_output\Management_REPORTS\Mailroom_CTD_Aging" & Format(Date, "yyyymmdd") & ".snp", False, "", 0
DoCmd.OutputTo acReport, "Mailroom_DOC_Aging", "SnapshotFormat(*.snp)", "\\lobot\corp\in-house-custodian\dc_output\Management_REPORTS\Mailroom_DOC_Aging" & Format(Date, "yyyymmdd") & ".snp", False, "", 0
DoCmd.OutputTo acReport, "Overall_CTD_Inventory_Aging", "SnapshotFormat(*.snp)", "\\lobot\corp\in-house-custodian\dc_output\Management_REPORTS\Overall_CTD_Inventory_Aging" & Format(Date, "yyyymmdd") & ".snp", False, "", 0
DoCmd.OutputTo acReport, "Overall_DOC_Inventory_Aging", "SnapshotFormat(*.snp)", "\\lobot\corp\in-house-custodian\dc_output\Management_REPORTS\Overall_DOC_Inventory_Aging" & Format(Date, "yyyymmdd") & ".snp", False, "", 0
DoCmd.OutputTo acReport, "QC_CTD_Aging", "SnapshotFormat(*.snp)", "\\lobot\corp\in-house-custodian\dc_output\Management_REPORTS\QC_CTD_Aging" & Format(Date, "yyyymmdd") & ".snp", False, "", 0
DoCmd.OutputTo acReport, "QC_DOC_Aging", "SnapshotFormat(*.snp)", "\\lobot\corp\in-house-custodian\dc_output\Management_REPORTS\QC_DOC_Aging" & Format(Date, "yyyymmdd") & ".snp", False, "", 0
DoCmd.OutputTo acReport, "Research_CTD_Aging", "SnapshotFormat(*.snp)", "\\lobot\corp\in-house-custodian\dc_output\Management_REPORTS\Research_CTD_Aging" & Format(Date, "yyyymmdd") & ".snp", False, "", 0
DoCmd.OutputTo acReport, "Research_DOC_Aging", "SnapshotFormat(*.snp)", "\\lobot\corp\in-house-custodian\dc_output\Management_REPORTS\Research_DOC_Aging" & Format(Date, "yyyymmdd") & ".snp", False, "", 0
DoCmd.OutputTo acReport, "Vault_CTD_Aging", "SnapshotFormat(*.snp)", "\\lobot\corp\in-house-custodian\dc_output\Management_REPORTS\Vault_CTD_Aging" & Format(Date, "yyyymmdd") & ".snp", False, "", 0
DoCmd.OutputTo acReport, "Vault_DOC_Aging", "SnapshotFormat(*.snp)", "\\lobot\corp\in-house-custodian\dc_output\Management_REPORTS\Vault_DOC_Aging" & Format(Date, "yyyymmdd") & ".snp", False, "", 0
DoCmd.Quit acSave
End Sub