Split Snapshot report into separate reports

  • Thread starter Thread starter LisaK
  • Start date Start date
L

LisaK

I have a snapshot report that is 100 pages. It is a report on 10 different
people and each person has 10 pages of information. I would like to save a
separate report for each individual. Can someone tell me how I would do this?

Thanks.
 
Run the reports 10 time with each being filtered to report on one person.
I am sure the person's name or ID is in the reports record source. So here
is what you could do.
Create a select query that would return one occurance of the ID for each
person.
Open the query as a recordset.
Loop through the recordset until you have read all the records.
On each iteration, run the report using the OpenReport method's Where
argument to limit the report to one person. Here is an example:

Dim rst As Recordset

Set rst = Currentdb.OpenRecordset("qryPeopleList")
With rst
If .RecordCount = 0 Then
MsgBox "No Records Found For Reports"
Else
.MoveLast
.MoveFirst
Do While Not .EOF
Docmd.OpenReport "MyReportName", , ,[PersonID] = ![ID]
.MoveNext
Loop
End With
rst.Close
Set rst = Nothing

[PersonID] would be the name of the field in the report's recordset that
identifies ther person
[ID] would be the field name in the query that would match [PersonID].
 
Thanks for your response. I am a basic Access user so everything you said is
over my head. I will maybe show it to someone here and see if they can
figure it out.


Klatuu said:
Run the reports 10 time with each being filtered to report on one person.
I am sure the person's name or ID is in the reports record source. So here
is what you could do.
Create a select query that would return one occurance of the ID for each
person.
Open the query as a recordset.
Loop through the recordset until you have read all the records.
On each iteration, run the report using the OpenReport method's Where
argument to limit the report to one person. Here is an example:

Dim rst As Recordset

Set rst = Currentdb.OpenRecordset("qryPeopleList")
With rst
If .RecordCount = 0 Then
MsgBox "No Records Found For Reports"
Else
.MoveLast
.MoveFirst
Do While Not .EOF
Docmd.OpenReport "MyReportName", , ,[PersonID] = ![ID]
.MoveNext
Loop
End With
rst.Close
Set rst = Nothing

[PersonID] would be the name of the field in the report's recordset that
identifies ther person
[ID] would be the field name in the query that would match [PersonID].

--
Dave Hargis, Microsoft Access MVP


LisaK said:
I have a snapshot report that is 100 pages. It is a report on 10 different
people and each person has 10 pages of information. I would like to save a
separate report for each individual. Can someone tell me how I would do this?

Thanks.
 
Back
Top