
Signature
Steve Schapel, Microsoft Access MVP
Steve,
Ok, the details are as follows:
Macro A is called via button click.
Macro A: Run Macro B, Repeat 100
Macro B:
1. Open Form frm-MassMailing
View Form
Data Mode Read Only
Window Normal
2. Run Macro
Macro Name Macro C
3. GoTo Record
Object Type Form
Obj Name frm-MassMailing
Record Next
Offset 1
Macro C
1. Open Report
Report Name rpt-MassMailing
View Print Preview
Where Condition (This works fine, and is lengthy, so omit)
2. OutputTo
Object Type Report
Object Name rpt-MassMailing
OutputFormat Snapshot Format
Output File C:\My Documents\Snapshots\CustName.snp
Auto Start No
3. Close
Object Type report
Object Name rpt-MassMailing
Save No
Please note everything works with the exception of the save by CustName.
Each report does save, but each overwrites the previous save due to the Ouput
File. Maybe there is a syntax that will work. I tried the ...\" &
[rpt-MassMailing] & ".snp" but no-go.
> SystemsInfo,
>
[quoted text clipped - 19 lines]
> > List].[CustName].snp. It loops ok, but all reports are saved with the one
> > file name.
Steve Schapel - 21 Feb 2006 17:54 GMT
SystemsInfo,
Well, it wouldn't be ...\" & [rpt-MassMailing] & ".snp" would it? I
thought you wanted the CustName in the name of the output file? You
already have a GoToRecord/Next action in the macro, so I am guessing
that there is a CustName control on the frm-MassMailing form, no? If
so, I think it would be:
...\" & [Forms]![frm-MassMailing]![CustName] & ".snp"
It is good that you r macro is working otherwise. However, I think
actions 1 and 3 in Macro C are redundant and can be removed. I can see
no advantage in opening the report in Preview mode and then closing it
again. And then I think I would myself be tempted to simplify like this...
Macro A is called via button click.
Macro A:
1. Open Form frm-MassMailing
View Form
Data Mode Read Only
Window Normal
2. Run Macro B, Repeat 100
Macro B:
1. OutputTo
Object Type Report
Object Name rpt-MassMailing
OutputFormat Snapshot Format
Output File ="C:\My Documents\Snapshots\" &
[Forms]![frm-MassMailing]![CustName] & ".snp"
Auto Start No
2. GoTo Record
Object Type Form
Obj Name frm-MassMailing
Record Next
...or, if the button to run this is in fact on the frm-MassMailing form,
like this...
Macro A is called via button click.
Macro A:
1. Run Macro B, Repeat 100
Macro B:
1. OutputTo
Object Type Report
Object Name rpt-MassMailing
OutputFormat Snapshot Format
Output File ="C:\My Documents\Snapshots\" & [CustName] & ".snp"
Auto Start No
2. GoTo Record
Object Type <blank>
Obj Name <blank>
Record Next

Signature
Steve Schapel, Microsoft Access MVP
> Steve,
>
[quoted text clipped - 36 lines]
> File. Maybe there is a syntax that will work. I tried the ...\" &
> [rpt-MassMailing] & ".snp" but no-go.