Printing differnt versions of a report

G

Guest

currently I have two select cases that allow users to pick the criteria they
wish to filter in the report.
However, the need has come to keep an electronic copy of all the different
combinations for "just in case".
Is there any way to click a button and have the reports run and
automatically save as a snapshot to the server.
To prevent the possiblility of the reports simply overwriting I have
included the title of the report in the downloaded name:

If Me.Labor = 1 Then
gstrTitle = "Direct Manpower"
ElseIf Me.Labor = 2 Then
gstrTitle = "Semi-Direct Manpower"
ElseIf Me.Labor = 3 Then
gstrTitle = "Maintenance Manpower"
ElseIf Me.Labor = 4 Then
gstrTitle = "Pre-Act Manpower"
ElseIf Me.Labor = 5 Then
gstrTitle = "All Manpower"
End If
If Me.Location = 1 Then
gstrRTitle = "Smyrna / Decherd"
ElseIf Me.Location = 2 Then
gstrRTitle = "Canton"
End If

then here is the current output to:
DoCmd.OutputTo acReport, "E - Offline Plant Summary Avg",
"SnapshotFormat(*.snp)", "I:\Paul\Test\Weekly" & gstrTitle & gstrRTitle &
".snp", False, "", 0

Which shows the location and labor code in the file name.

If need be I can paste the entire code... I just not certain how things work
in this site...
 
G

Guest

First, create an array with the titles:

aryRpts = Array("Direct Manpower", "Semi-Direct Manpower", "Maintenance
Manpower", "Pre_Act Manpower", "All Manpower")

This part is okay:
If Me.Location = 1 Then
gstrRTitle = "Smyrna / Decherd"
ElseIf Me.Location = 2 Then
gstrRTitle = "Canton"
End If

Now loop through the array and create a report for each:
For intRpt = 0 to Ubound(aryRpts)
gsrtTitle = aryRpts(intRpt)
DoCmd.OutputTo acReport, "E - Offline Plant Summary Avg",
"SnapshotFormat(*.snp)", "I:\Paul\Test\Weekly" & gstrTitle & gstrRTitle &
".snp", False, "", 0
Next intRpt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top