Print only "Page 1" of my report

  • Thread starter Thread starter rwrede
  • Start date Start date
R

rwrede

I am not an expert at Access, I simply created a form and it's subsequent
report I use at work
as an order form. When I want to print the report (order form) I must be
careful to remember and set 'print properties' to "Page 1 of 1" or I end up
printing all the pages in my report. In my case, when I click my "View
Report" button, the first page I see is the last form entry I made (this is
a good thing), and when I click File>Print it prints all the pages not just
the one I see in the print preview (I know this is by default, it is
printing my "Report") of course I can set "Page 1 of 1" in the print
properties but sometimes I forget... Is there a code I can add so when I
click "View Report" I only get page one? Or
better yet, the page I am viewing in the print preview at the time.?
 
When you click View Report, is this a button on the form? If so, the code
behind the button is probably using the DoCmd.OpenReport command. One of the
parameters of this command is to pass a "Where" clause to the report. This
would allow you to filter the report to just the current record on the form.
Since that will be the only record displayed in the report, then that will
be the only record printed.

Another option would be to create your own print button on the toolbar and
bind it to code that would print only the first page of the active object.
If you place a button on the form to do this, you'll have to include a
SetFocus statement to set the focus to the report before you call the
PrintOut command since the command works on the active object.

Example:
(VBA)
DoCmd.PrintOut acPages, 1, 1

If you put a button on the toolbar, it will use a Macro for it's action. The
PrintOut command is also available in a macro with the same options.
 
UUmmm. Like I said I'm no expert, could you please explain it again in
layman terms? And no, when I click View Report, it is using the default
switchboard button to view...report...
 
Ok, since you're using a "default" button to display the report, the easiest
thing may be to create your own button on the toolbar that will only print
the first page. To do this, first create a macro that will print only the
first page. Go to the Macros window and choose New. Under Action choose
PrintOut then go to the bottom of the window and set Print Range to Pages,
Page From and Page To to 1. Save the macro giving it a unique name,
mcrPrintFirstPage should work.

Now, to create the button on the toolbar. Open a report (any report) to get
the report toolbar to display. Click the down arrow at the very right end of
the toolbar and choose Add Remove Buttons, then Customize. On the Commands
tab, go to choose File in the left window then in the right window, scroll
down and drag and drop Print onto the toolbar at the desired location. Right
click the new button and choose Edit Image..., Draw a 1 over the printer
icon so that you can distinguish this button from the regular print button,
click Ok when done. Next, right click the new button and choose Properties.
Change the caption to PrintFirst, the screen tip to Print First Page and the
On Action to the name of your macro then click Close. Now click Close on the
Customize dialog to close it and this will take you out of the toolbar edit
mode. Clicking your new button on the toolbar will print only the first page
of a report.
 
I've tried but you've got to realize I'm a novice, so please bear with me
:-) ok, you say go to the Macros window, Where? I bet I can figure it out
from there but can't seem to find that macros window...
 
Sorry about that last post, Of course as soon as I posted it I found the
Macro window, (I was looking in VBA and Up in the Form Design toolbars) and
the button works great! I learned allot like editing buttons, I had no idea,
This has been a great lesson!!! Thanks!!!
 
Back
Top