I
iyke
Hi all I have a problem exporting MS access report to a folder on my
system.
I have a monthly report in MS Access and I have about 50 users that
send this report every month. I want to write a VBA code that will
export this report with the IDs of the 50 users in my database and i
want the exported report to be stored in a folder in my harddrive.
I have a Macro which I have converted into VBA code that will export
the report to e designated folder in my harddrive.
But my challenge is how to use a loop to export the report to each of
the 50 users in my table. particularly, how do I assign the report to
the ID of each user.
My Code is below
Function Macro1()
On Error GoTo Macro1_Err
DoCmd.OutputTo acReport, "INIT_Staff", "SnapshotFormat(*.snp)",
"C:\Documents\Reports1", True, "", 0
Macro1_Exit:
Exit Function
Macro1_Err:
MsgBox Error$
Resume Macro1_Exit
End Function
I can create a recordset and write a loop that will perform this
operation 50 times but where do I specify that for each time the code
is executed output the report as user ID_reportname.snp
Please help
system.
I have a monthly report in MS Access and I have about 50 users that
send this report every month. I want to write a VBA code that will
export this report with the IDs of the 50 users in my database and i
want the exported report to be stored in a folder in my harddrive.
I have a Macro which I have converted into VBA code that will export
the report to e designated folder in my harddrive.
But my challenge is how to use a loop to export the report to each of
the 50 users in my table. particularly, how do I assign the report to
the ID of each user.
My Code is below
Function Macro1()
On Error GoTo Macro1_Err
DoCmd.OutputTo acReport, "INIT_Staff", "SnapshotFormat(*.snp)",
"C:\Documents\Reports1", True, "", 0
Macro1_Exit:
Exit Function
Macro1_Err:
MsgBox Error$
Resume Macro1_Exit
End Function
I can create a recordset and write a loop that will perform this
operation 50 times but where do I specify that for each time the code
is executed output the report as user ID_reportname.snp
Please help