Preview Specific Page

G

Guest

Hi all,
My report always has 2 pages, and we print Double side (Printer is one side
only - HP1300). In my form, I put 2 buttons: Page1 and Page2. I want to
Preview the report before print it out. So how can you code the Page1 button
to preview only Page 1, and Page2 button to Preview only Page 2 ?
I've tried:
docmd.OpenReport "ReportName",acViewPreview
docmd.PrintOut acPages,1,1
But then it print out, and when I zoom the report, all pages are visible and
printable.
Any suggest ?
Thanks.
 
G

Guest

Is there anything in the report that seperates the two pages, such as a
section or a subreport?

Barry
 
G

Guest

No. Ther are just some TextBoxs that have Can Grow/Shrink set to Yes, then
the contents of the 1st page and 2nd page may change.
 
G

Guest

Assuming you always have two pages, you can add a SENDKEYS when you want it
to go to the second(last) page, like this:

DoCmd.OpenReport "rptMyReport", View:=acPreview
SENDKEYS "{END}"

Leave off the sendkeys when you want to preview the first page.

Disclaimer: I rarely use sendkeys. In this case this doesn't seem to be any
standard solution.

Barry
 
G

Guest

Thanks for your assistance. But I want to preview ONLY page1 without page 2,
as well as ONLY page 2 without page 1. "In this case this doesn't seem to be
any standard solution". I agree with you. I've worked on it for a long time
to see nothing. Just post here to see if someone can help.
Thanks always.
 
G

Guest

I asked about sections etc. because I thought you might be able to get to it
by programmatically limiting the display of certaiun objects or ranges of
data. Would it be practical to carve the report into two subreports and
selectively hide one or the other? Or perhaps limit the data to the ranges
that would normally fit on each respective page?

Barry
 
G

Guest

Hi Barry,
Thank you very much for your concern. I'll try my best to describe what I'm
doing now. The report is based on an official form, and it is design to
display all information if available, and hide if not available, as well as
reduce the blank (cause by the unavailable info).
Until now, I have 3 reports: The 1st has only ranges of data in page 1, the
2nd has only ranges of data of page 2, the 3rd has both. In most case, data
in page 1 doesn't bypass to page 2, then I need only 2 reports (1,2) and it's
OK with 2 buttons (Page1, Page2) in my form. But sometime, it bypass, and
then I need the 3rd report, and it is the issue. Since the users are familiar
with click and view and print, when s/he click Page1/Page2 to view and print,
the data might be lost. If they click the "All Pages" button, they might
print out to 2 Sheets, instead of 1 double side sheet. Then I intent to look
for another solution, e.g: Only 1 report (the 3rd), and click button 1 to
view ONLY Page 1, button 2 to view ONLY Page 2. Of course, I can print out
directly the specific pages by click appropriate buttons, but I want to
PREVIEW the report first, to make sure it's correct and have all available
info before print it out.
Hope that is clear (English isn't my mother tongue).
Best regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top