have a macro in Access that opens 10 different reports. Each report is sent to an output file with a different name. Is there a way to add a field from the report to the outpur file name? Attached is the code.
Option Compare Database
'------------------------------------------------------------
' Accounting_Reports1
'
'------------------------------------------------------------
Function Accounting_Reports1()
On Error GoTo Accounting_Reports1_Err
DoCmd.OutputTo acReport, "4 Telecomm Giro Paisano (Acct Rpt) May 2004", "SnapshotFormat(*.snp)", "g:\user\eporeports\Giro Paisano 022207.snp", False, ""
DoCmd.OutputTo acReport, "4 Telecomm Giro (Acct Rpt) May 2004", "SnapshotFormat(*.snp)", "G:\user\eporeports\Giro Telegrafico 022207.snp", False, ""
DoCmd.OutputTo acReport, "2 Telecomm Trans (Acct Rept) Dia Siguiente May 2004", "SnapshotFormat(*.snp)", "G:\user\eporeports\Dia Siguente 022207.snp", False, ""
DoCmd.OutputTo acReport, "2 Telecomm Trans (Acct Rept) Din Min May 2004", "SnapshotFormat(*.snp)", "G:\user\eporeports\Dinero en Minutos 022207.snp", False, ""
DoCmd.OutputTo acReport, "7 Bital Acct Rep 11xx02", "SnapshotFormat(*.snp)", "G:\user\eporeports\Bital 022207.snp", False, ""
DoCmd.OutputTo acReport, "9 Banamex Foreign Fx adjusted", "SnapshotFormat(*.snp)", "G:\user\eporeports\Banamex Foreign FX 022207.snp", False, ""
DoCmd.OutputTo acReport, "9 Banamex US FX adjusted", "SnapshotFormat(*.snp)", "G:\user\eporeports\Banamex US FX 022207.snp", False, ""
DoCmd.OutputTo acReport, "CEMECA Acct Rept 021904", "SnapshotFormat(*.snp)", "G:\user\eporeports\CEMECA 022207.snp", False, ""
DoCmd.OutputTo acReport, "6 Commercial Mexicana Accounting Report Foreign", "SnapshotFormat(*.snp)", "G:\user\eporeports\Commercial Mexicana Foreign 022207.snp", False, ""
DoCmd.OutputTo acReport, "6 Commercial Mexicana Accounting Report US", "SnapshotFormat(*.snp)", "G:\user\eporeports\Commercial Mexicana US 022207.snp", False, ""
DoCmd.OutputTo acReport, "8 HEB Foreign FX Adjusted", "SnapshotFormat(*.snp)", "G:\user\eporeports\HEB Foreign 022207.snp", False, ""
DoCmd.OutputTo acReport, "8 HEB US FX adjusted", "SnapshotFormat(*.snp)", "G:\user\eporeports\HEB US 022207.snp", False, ""
DoCmd.OutputTo acReport, "AMEX Inbound Accounting Report", "SnapshotFormat(*.snp)", "g:/user/eporeports/Amex Inbound Accounting Report 022207.snp", False, ""
Accounting_Reports1_Exit:
Exit Function
Accounting_Reports1_Err:
MsgBox Error$
Resume Accounting_Reports1_Exit
End Function
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.