Changes to Printer object are not applied

C

Colin Chudyk

Hello,
With Me.Printer


I am making changes to the printer object in the Open event of my report.
The code is like this:
.PaperSize = rstReport!rpt_PaperSize
.Orientation = rstReport!rpt_PageOrient
.DefaultSize = False
.ItemSizeWidth = sngReportWidth
.ItemsAcross = 1
End With

However, once the report has loaded, it retains the page setup settings from
the previous run (or simply offers unpredictable results). But this can
easily be fixed by simply opening the Page Setup dialog and clicking OK. The
settings I made in code appear in the Page Setup dialog, and when I click OK
they are applied.

How can I APPLY the settings in my code? Is there some method I can call
that will offer the same function as clicking the OK button in the Page
Setup dialog? I can't find it anywhere...

This also seems to be the case when setting the Width property of the Report
object itself from the Open event. By the way, this app is going to run as
an MDE so there is no way I can open anything in design view to set
properties..... although that would solve a lot of problems!

Thanks,
Colin
 
S

SA

Colin:

You can NOT reliably set printer object properties from within a report's
VBA module, especially in its On Open event. As with past versions of
Access, you must go into design mode for the report make the changes and
then either preview or to print.

In working with MDE's if you have reports that need to have the same data
but with different layout, you need to use multiple report objects. There's
no work around.
 

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