PRINT ONLY FIRST PAGE

P

pauld

How do I only print the first page of a multi-page Report using the Access
2003 macros?

I thought I could use the PrintOut macro but it doesn't provide any place to
select the Report.

If I use the OpenReport macro, it prints all of the pages.

I thought I could use SelectObject and name the Report and then use
PrintOut, but that doesn't work either.

Help!

Thanks.
 
M

Mr B

pauld,

The PrintOut method is your answer.

The PrintOut method prints the active object so just open the report you
want to print and then immediately use the PrintOut method, specifying the
starting and ending pages.

You can use a command button to open your report in preview mode, print it
using the PrintOut method and then optionally you could even close the report.

The code for the command button would be something like the following
untested code to open your report, print the first page and close your report:

DoCmd.OpenReport "NameOfYourReport", acViewPreview
DoCmd.PrintOut acPages, 1, 1
DoCmd.Close acReport, "NameOfYourReport"
 
P

pauld

So.....using only the Macros provided by Access 2003, am I understanding that
I should:

1. Use OpenReport to identify the Report...and open it in Print Preview mode
2. Use PrintOut to print the range of pages (1-1)
3. Use Close...to close the Report

Will this remove the Print Preview from the screen and return it back to the
form with the Command Button?

Thanks for your help.
 
M

Mr B

Yes, that is the way it works.

The only way that the PrintOut method can be used is to print the active
object - form, query, table, or report.

Opening the report in Preview mode will make it the active object.

The PrintOut method will print what you specify of the report.

Closeing the report will remove it from the screen. You should not have to
do anything els, but if you do, you might need to set focus to some control
on some form.
 
G

Gerrit Homminga

pauld said:
So.....using only the Macros provided by Access 2003, am I understanding
that
I should:

1. Use OpenReport to identify the Report...and open it in Print Preview
mode
2. Use PrintOut to print the range of pages (1-1)
3. Use Close...to close the Report

Will this remove the Print Preview from the screen and return it back to
the
form with the Command Button?

Thanks for your help.
 
H

huangda 晋江兴达机械

pauld said:
So.....using only the Macros provided by Access 2003, am I understanding
that
I should:

1. Use OpenReport to identify the Report...and open it in Print Preview
mode
2. Use PrintOut to print the range of pages (1-1)
3. Use Close...to close the Report

Will this remove the Print Preview from the screen and return it back to
the
form with the Command Button?

Thanks for your help.
 

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