[AccessD] Is There a Way to Invoke the Windows "PrintDialogue"from VBA code?

Steve Schapel steve at datamanagementsolutions.biz
Thu Nov 15 15:50:53 CST 2012


Hi Brad

Try this:
DoCmd.RunCommand acCmdPrint

Regards
Steve

-----Original Message----- 
From: Brad Marks
Sent: Friday, November 16, 2012 10:43 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Is There a Way to Invoke the Windows 
"PrintDialogue"from VBA code?

More Background...

I have tested some VBA code that uses the "SendKeys" command.

This works Okay, but I remember reading someplace, a couple years ago,
that it is good to avoid this approach.

Therefore I am looking for an alternative to "Sendkeys"

Thanks,
Brad



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks
Sent: Thursday, November 15, 2012 3:23 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Is There a Way to Invoke the Windows "Print
Dialogue"from VBA code?

All,

We have a small report (1-5 pages) that is printed very frequently.

The primary user has two monitors.  She has a purchased application
system shown on one monitor for data entry.

She uses the second monitor to view the small report  (built with Access
2007).  This works nicely.

The Access report has a button to "Refresh" the data (DoCmd.Requery).
This also works nicely.

Every once in a while, the user will change the data in the purchased
application system and forget to push the refresh button on the Access
report.  When this happens, the data shown on the printed report is not
up to date.

Currently, to print the report, the Windows "Print Dialogue" is invoked
from the "Big Round Button" (top left).  This dialogue gives the user
the ability to print multiple copies and/or to print select pages.

I would like to add a button to the report to (1) refresh the data (2)
invoke the Windows Print Dialogue.

Is there a way to do this with VBA code?

Thanks,
Brad

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com 



More information about the AccessD mailing list