I currently have a report that is filtered with a list of clients from a separate table, however, I need to create a a copy of that report for each client. Below is the code that I currently have:
This code is making copies of the original report without the filter and I'm not sure how I would combine the OpenReport and Copy command in 1 line.
Any ideas??
Code:
Public Function OrgIDReports()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim sqlStr As String
sqlStr = "SELECT * FROM [Temp Table]"
Set db = CurrentDb
Set rs = db.OpenRecordset(sqlStr)
rs.MoveFirst
Do While Not rs.EOF
DoCmd.OpenReport "I# Report", acViewPreview, , "[Carrier Report].[I#]=" & rs![I#], acHidden
DoCmd.RunCommand acCmdSaveAsReport
rs.MoveNext
Loop
MsgBox ("End of Client Org IDs")
End Function
Any ideas??
Comment