Buttons, buttons

  • Thread starter Thread starter Sheri Emery
  • Start date Start date
S

Sheri Emery

Hi,
I want to put together a single command button that prints
two reports. I've been able to construct a macro that
uses the "PrintOut" feature, but am running into a couple
of snags in what it prints. First of all, it was printing
the switchboard, so I added commands that would close the
switchboard first, then open it again as the last action.
In the middle, I used commands that would open both
reports, PrintOut, then close both reports. I get a bunch
of different results (including multiple copies) based on
how quick the printer moves. Is there something I can do
to make it print only the two reports?
Thanks for your help.
 
Try using OpenReport with an argument of Normal instead of Preview -
it will print directly.
I'd suggest avoiding PrintOut.
 
Try using the code behind the form. The buttons OnClick insert this:

Dim stDocName1 As String
Dim stDocName2 As String

stDocName1 = "MyReport1"
stDocName2 = "MyReport2"
DoCmd.OpenReport stDocName1, acViewNormal
DoCmd.OpenReport stDocName2, acViewNormal

Hope this helps.
 
Sheri,

Just to simplify Penguin's code a little, this is all that is required
in a VBA procedure...

DoCmd.OpenReport "MyReport1"
DoCmd.OpenReport "MyReport2"

However, I also note that you are using a macro. The same thing would
apply. Just use two OpenReport actions in the macro, one for each report.
 
Yes, I forget that the simplest way is always a straight road.

Happy New Year to all !!!
 
I have the PrintOut option and now it is not working on my report. Any reason
you suggest staying away from it? I want the user to be able to preview the
report and select whether or not they want to print - so the acNormal is not
what I need.

Any suggestions??
 
As far as avoiding the PrintOut option goes, I think your experiences
(detailed in your first post) should answer that one.
If you're allowing the normal menu bar or toolbar when you display the
report, your users can simply select the Print toolbar item, or the File -
Print option on the menu.
If you're hiding both of these built-in toolbars, you can make your own
toolbar, showing only the options you want (perhaps some zoom options, and a
close option as well as Print.)

HTH
- Turtle
 
Back
Top