One page limit via print macro

G

GD

I have a command button on a form that prints the form via a macro. SQL:

Private Sub PrintFunction_Click()

Dim MyForm As Form
Dim pageno As Integer
pageno = Me.CurrentRecord
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, MyForm.Name, True
DoCmd.PrintOut acPages, pageno, pageno, , 1
DoCmd.SelectObject acForm, MyForm.Name, False

End Sub

However, right now it prints on several sheets of paper. How do I get it to
reduce in size so that it prints on one page only, using SQL? Thanks for the
help!
 
G

GD

I know it's not recommended, but my company's procedures require us to print
from the form. Is it not possible to control the print job of a form through
SQL?
 
D

Douglas J. Steele

Definitely not possible through SQL, and even through VBA (which is actually
what your sample is), there's no way to reduce the size of a form so that
it'll fit on a single page.
 
C

Clifford Bass

Hi,

In that case, you can do it if you use your printer driver's scaling
capabilities. Since that setting can vary all over the place, you will need
to explore that. It may need to be set up each time some starts up Access.
Although that does not seem to be the case for me in testing this just now.
Some drivers provide for the ability to save various configurations. The
other possibility may be to set up a report that just has the form placed in
its detail section. Then in the print setup setting it to use a specific
printer and setting that printer's scaling setting as needed. This seems to
work in Access 2007. I have not tested in earlier versions or what happens
when you reboot the machine.

Good Luck!

Clifford Bass
 

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