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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting print margins from form event

Status
Not open for further replies.

pullingteeth

Programmer
Sep 26, 2003
128
US
Hello, I have a form which lays out a series of address labels for printing. When the user is ready to print, they press a button, and application deals with the printing for them. Since my users are Lusers, I would like to (as part of the print process) either a) set the print margins for them (since Access print margins seem to vary from machine to machine) or b) pop up a msgbox telling them what print margins they need to set, and then pop up the print margins box for them.

There are two ways to do b, as far as I can see, except that neither works.

Option i is:

RunCommand acCmdPageSetup

and Option ii is:

SendKeys "...."

Unfortunately, using either method, I get the error message:

"The action can't be carried out while processing a form or report event."

This error message applies almost only to page setup; I can run other commands and do other sendkeys things.

So, does anybody know how to either make option a) work, or fix one of the option b) alternatives?

Thanks!
 
Pullingteeth,

Be careful, there may be "Lusers" monitoring this site! [nosmiley]

You can set the paper characteristics using VBA code IF you have a .MDB or an .ADP ... The logic requires opening the report in design view, so it won't work with .MDE or .ADE.

Roll up your sleeves and dig into Thread702-560490



HTH,
Bob [morning]
 
Hope you weren't offended by the word "lusers" - it's general programmer's shorthand for "people who use computers but haven't a clue how to". Seriously, the people who are using computers here are intimidated by a list of instructions such as 1) Open the [File] Menu 2) Select [Page Setup] 3) Adjust the margins to...

Great thread link. Unfortunately, I plan to compile the database application into an MDE, mainly for the speed boost. Any other ideas?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top