Refreshing Report to Accept Printer changes

R

rmcompute

I was able to successfully change the Orientation and Page size in the open
event of a report, however, it does not reflect in the report display unless
I go into design mode and click OK. Is there a command that can be issued
after the commands listed below, which will make these changes take effect
without having to go into design mode and click OK ?

'Me.Printer.Orientation = acPRORPortrait
'Me.Printer.PaperSize = acPRPSLetter
 
A

Allen Browne

In Access 2002 or 2003, that should work in Preview without needing to go to
design view.

It won't work if you have opened in acViewNormal, i.e. printing without
preview.
 
R

rmcompute

I have Access 2003 and for now I am running the report by just clicking on
it. The code in the Open event is as follows:

Me.Printer.Orientation = acPRORLandscape
Me.Printer.PaperSize = acPRPSLegal

After the report comes up it is in Portrait with Letter size. If I click
File/Page Setup ... and select the Page tab, it is set as follows:

Orientation = Landscape
Size = Legal(8.5 x 14 in)

So obviously the code is working. It is just not changing the report until
I click OK.
Is there a VBA command to issue after the above commands which would be the
equivalent, or perhaps some report refresh ?
 
A

Allen Browne

So setting the orientation works, but setting the paper size does not?

You could try swapping the commands around (PaperSize first) to see if
setting the orientation causes it to wake up to the paper size.

I know I have set the margins and orientation using this approach, but I
can't recall trying to set the paper size. It may be that you need to set
the PaperSize before you open the report, i.e. Report_Open is too late.
Experiment and see if that makes a difference.

The alternatives are not attractive. If you've never worked with PrtMip,
it's a bit of a dog's breakfast. See:
http://msdn.microsoft.com/archive/d...umControllingYourPrinterinMicrosoftAccess.asp
 

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