Jane wrote:
I have a database for my students' grades. A grade sheet is opened via
a form in which you select which student(s) you want to see. I have a
few different types of grade sheet reports. If I want to print out 2
reports together, is there a way do it besides for docmd.openreport...
two times? Say I want grade sheets for 5 students. The above method
opens two separate reports, 5 pages each, and then I have to collate
them. Can I get both reports for each student to come out together?
(without, of course, designing a new report that integrates two others)
Thanks
You should be able to filter each report to print a grade sheet for
only a specified student by specifying a where clause on the
docmd.openreport command, e.g.
docmd.openreport "rptGradeSheet_1",acViewNormal,,"StudentID=" &
intStudentID
docmd.openreport "rptGradeSheet_2",acViewNormal,,"StudentID=" &
intStudentID
where 'intStudentID' is a single student ID.
If you loop on each student and print each report in this fashion it
will print out the grade sheets in order by student. For example, if
you have a table of students called tblStudents and the student ID
field is called StudentID you could print all of the grade sheets as
follows:
dim rst as recordset
set rst = currentdb.openrecordset("tblStudents")
do until rst.eof
docmd.openreport "rptGradeSheet_1",acViewNormal,,"StudentID=" &
rst!StudentID
docmd.openreport "rptGradeSheet_2",acViewNormal,,"StudentID=" &
rst!StudentID
...
docmd.openreport "rptGradeSheet_n",acViewNormal,,"StudentID=" &
rst!StudentID
rst.movenext
loop
Bruce