Multiple MS Access report instances available for preview

xli2002
xli2002 used Ask the Experts™
on
I have a form which provides choices to select how many reports for preview. I use a temp table to store user's choices. Then loop through the choices to try to preview all reports. The code is like the following:
While Not rs2.EOF
 Call SetCurrentAENo(rs2!AENo)
 DoCmd.OpenReport "rptMedSearch", acViewPreview
 rs2.MoveNext
Wend
The problem is I only get the 1st report, no more showing up in screen. If I change DoCmd to DoCmd.OpenReport "rptMedSearch", acViewNormal.
All the reports will be printed out.
However I want to all reports showing up one by one in the screen.
Any ideas?
Really appreciate your help.

Lisa
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I think you are limited to showing a single report by the same report name in Access.  I've tried to do it myself.

You can however, clone the report as many times as you want as long as they each have a different name, so you could append a number to the report (rptMedSearch1, rptMedSearch2, etc) then when you call it, maintain a variable that has how many reports are open and use something like:
DoCmd.OpenReport "rptMedSearch" & NumReport, acViewPreview

Author

Commented:
Because AeNo is dynamically generated, I don't know how many report instances I want each time. From help file, I don't see there is a method to clone a report. Could you please give me more detail help about cloning reports?

twalgrave, your help is greatly appreciated.
Thanks a lot.

Lisa
Sorry about the delay of this response. I didn't get an email notification (EE experiencing some probs)
When I speak of cloning a report in Access, I'm referring to copying the report from access, and pasting it with another name.  Hope this helps Lisa.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- answered by twalgrave
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

twalgrave
Cleanup Volunteer
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial