Printing reports to printer

buratti

Registered User.
Local time
Today, 12:39
Joined
Jul 8, 2009
Messages
234
I have code that opens a report for the current open form. It works fine, BUT, I would like for it to print directly to the printer rather than prieview it.
My code attached to my print report button is:
DoCmd.OpenReport "Card Charge Form", acViewPreview, , "[Order ID]=" & OrderID, acDialog

If I change acViewPreview to acViewNormal it prints a report for ALL records, and not the selected one that displays with the Preview command.

What am I doing wrong by making it print all records, and what do I need to change to have it print just one record/report?

Better yet... Would it be possible to open the report in preview mode (like it does already), then have a dailog or some kind of button attached to it that when clicked, it will print the report?
 
Not sure what you're doing to make it print all records in acViewNormal if you're really getting only one record in acViewNormal.

As to your other point though, if the report opens properly in Preview, then why not just click File and Print? You don't need any fancy dialog, the functionality is right there.
 
Not sure what you're doing to make it print all records in acViewNormal if you're really getting only one record in acViewNormal.
Yeah I know, thats exactly why I had to come here and ask what im doing wrong.
As to your other point though, if the report opens properly in Preview, then why not just click File and Print? You don't need any fancy dialog, the functionality is right there.
Two reasons... First when the preview window opens, it "locks" all access to other open forms, menu bars and any other region of Access outside the preview window until that window is closed, hence cannot click File - Print.
And second, When everything is completed with the design of my database, I plan to "hide" the Access window to make it appear as if my database is a standalone application, and will not be able to access File - Print.
 

Users who are viewing this thread

Back
Top Bottom