J
johnnywinter via AccessMonster.com
I am on to step 2- to save reports as snapshot with the file names as fields
from the recordset or table. Thanks to pietlinden, jerrydata and raskew
(bob) for all their help to get me this far.
I loop a recordset to filter a report and print only those records matchinfg
the record in the recordset
What I want to do:
Output a Snapshot file instead of a report and make the directory if not
already there and then save the SNP in:
C:\Commissions\ [Month] [Year] \ & [REP] &.snp
[Month] [YEAR] are both fields in each record selected to print
[REP] is a field that is in each record selected to print (also is in the
recordset)
PROBLEMS:
1) the below code that filters prefectly in printing. . .. does not filter
records when saving as a snp.
2) How do code the location to use the [fields] in both the subfolder name
and the file name
Here's my code that works perfectly to print out hardcopies.
*************************************************************************************************
Private Sub Command0_Click()
Dim rsRep As DAO.Recordset
Set rsRep = DBEngine(0)(0).OpenRecordset("REPMASTER", dbOpenTable,
dbForwardOnly)
Me.Filter = "[Rep]= '" & rsRep.Fields!REP & "' "
Me.FilterOn = True
Do Until rsRep.EOF
doCmd.OpenReport "Curr Mo Collections By Rep", acViewNormal, Me.Filter, "
[Rep]= '" & rsRep.Fields!REP & "' "
doCmd.Close acReport, "Curr Mo Collections By Rep", acSaveNo
rsRep.MoveNext
Loop
rsRep.Close
Set rsRep = Nothing
End Sub
**********************************************************************************************
from the recordset or table. Thanks to pietlinden, jerrydata and raskew
(bob) for all their help to get me this far.
I loop a recordset to filter a report and print only those records matchinfg
the record in the recordset
What I want to do:
Output a Snapshot file instead of a report and make the directory if not
already there and then save the SNP in:
C:\Commissions\ [Month] [Year] \ & [REP] &.snp
[Month] [YEAR] are both fields in each record selected to print
[REP] is a field that is in each record selected to print (also is in the
recordset)
PROBLEMS:
1) the below code that filters prefectly in printing. . .. does not filter
records when saving as a snp.
2) How do code the location to use the [fields] in both the subfolder name
and the file name
Here's my code that works perfectly to print out hardcopies.
*************************************************************************************************
Private Sub Command0_Click()
Dim rsRep As DAO.Recordset
Set rsRep = DBEngine(0)(0).OpenRecordset("REPMASTER", dbOpenTable,
dbForwardOnly)
Me.Filter = "[Rep]= '" & rsRep.Fields!REP & "' "
Me.FilterOn = True
Do Until rsRep.EOF
doCmd.OpenReport "Curr Mo Collections By Rep", acViewNormal, Me.Filter, "
[Rep]= '" & rsRep.Fields!REP & "' "
doCmd.Close acReport, "Curr Mo Collections By Rep", acSaveNo
rsRep.MoveNext
Loop
rsRep.Close
Set rsRep = Nothing
End Sub
**********************************************************************************************