Connecting Tech Pros Worldwide Help | Site Map

printing two reports together

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 14th, 2006, 09:25 AM
Jane
Guest
 
Posts: n/a
Default printing two reports together

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


  #2  
Old November 14th, 2006, 08:05 PM
deluxeinformation@gmail.com
Guest
 
Posts: n/a
Default Re: printing two reports together


Jane wrote:
Quote:
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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.