Buttons, buttons

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.
 
M

MacDermott

Try using OpenReport with an argument of Normal instead of Preview -
it will print directly.
I'd suggest avoiding PrintOut.
 
P

Penguin

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.
 
S

Steve Schapel

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.
 
P

Penguin

Yes, I forget that the simplest way is always a straight road.

Happy New Year to all !!!
 
G

Guest

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??
 
M

MacDermott

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
 

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