Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Built-In Dialog Box

Status
Not open for further replies.

georgp

Technical User
Mar 28, 2002
96
US
Hi,

before printing my reports I would like to be able to select the printer using the Access standard dialog box, popping up especially if the defaultprinter is not available.
How can I open the standard dialog box and how can I test, if the defaultprinter is available?
(I want to hide the standard menu bars, so that users can not manipulate other db properties).
And then - is there a general way to open the built-in forms?

Thanks for any hint, georgp
 
add the following code when calling your reports:

''''''
DoCmd.OpenReport "ReportName", acViewPreview
SendKeys "^p", False
''''''

You're programatically with SendKeys telling Access to key Control + p. This should open the dialog and allow you to choose the print options you want.

The last part of your post regarding opening forms...

Do you mean code like

DoCmd.OpenForm "YourFormName"

or are you looking for something more advanced than this?

hope this helps you.
 
Thanks a lot, cghoga, the Sendkeys work!!
However, it is the second best solution - the form pops up every time I print something. I would like to have the form pop up only, if the default printer is not the currently connected printer (I work in the office and at home with different printers) - so I need code to test for this.
Regarding the second point, I just was wondering, if there is a general way to get the Access built-in forms pop up. From your post, I understand that other Sendkey commands might do this and I will run some tests.
If you have any additional ideas, let me know.
Thanks again, georgp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top