J
johnnywinter via AccessMonster.com
Thought I would start a new thread since where the forum has pointed me is
different.
I want to filter a Report by using a Recordset to filter the table
"CurrMoCollectionsByRep" on which the Report is based.
All I want to do is to print a separate Report for each value of [REP] in the
table "REPMASTER" (the Recordset.
My code loops through the Recordset, but does not filter out any records, so
it ends up printing an unfiltered report for each record in the recordset.
Help please. I am having a problem getting this? A senior moment?
*****************************************************************************************
Private Sub Command2_Click()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("REPMASTER")
With rst
Do Until .EOF
doCmd.OpenReport "Curr Mo Collections By Rep", acViewNormal, "rst!REP =
CurrMoCollectionsByRep!REP =True"
doCmd.Close acReport, "Cash Collections By Rep", acSaveNo
..MoveNext
Loop
..Close
End With
End Sub
different.
I want to filter a Report by using a Recordset to filter the table
"CurrMoCollectionsByRep" on which the Report is based.
All I want to do is to print a separate Report for each value of [REP] in the
table "REPMASTER" (the Recordset.
My code loops through the Recordset, but does not filter out any records, so
it ends up printing an unfiltered report for each record in the recordset.
Help please. I am having a problem getting this? A senior moment?
*****************************************************************************************
Private Sub Command2_Click()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("REPMASTER")
With rst
Do Until .EOF
doCmd.OpenReport "Curr Mo Collections By Rep", acViewNormal, "rst!REP =
CurrMoCollectionsByRep!REP =True"
doCmd.Close acReport, "Cash Collections By Rep", acSaveNo
..MoveNext
Loop
..Close
End With
End Sub