Can report/printer margins be changed at runtime

bignose2

Registered User.
Local time
Today, 06:05
Joined
May 2, 2010
Messages
248
Hi,

Put up with this problem for years now but wondered if there is now a solution.
Access 2007 RUNTIME
I have 2 different printers, 1 for invoices A5 & one for general use A4.

I use
- Allenbrowne.com/AppPrintMgt.html
and can change printers & some stuff but can't change margins.

Is there a way to change these margins via VBA that can be set in RUNTIME.

Like now, I have just had thousands of invoices pre-printed layout but the company managed to move the margin 5mm over so I have to program my MDB reports to reflect that.
Not hard but every now & again I have to do do this, no very professional & not something anyone else could do.

I see this question gets asked quite a lot and solutions offered but they always apply to Non-Runtime situations, I can program that no problem.

Thanks I/A
 
Take a look here. Seems to be what you are looking for.
I tried in report module:
Code:
With Me.Printer
  .
End With
and looks good. All the properties for Printer are there.

Also I think that you can set this properties from anywhere via
Code:
Dim varRep as Report
Set varRep = ReportName
With varRep.Printer
  bla bla bla
End With
 
Many thanks for taking the time to investigate,

I probably have not made myself completely clear

When I say runtime, I mean started either with the /runtime switch which locks the program or on a distributed runtime database .mde or .accd.

I have computers on the network that don't have MS Access installed and I use the Runtime installation, Also I like to lock down the one PC that it is installed.

This prevents any form or report being opened ACDesign, unless I am missing something.

The example you refer to just won't work (errors) is this situation, unless I am missing something but I have tried lots of times.

Thanks again.
 
Hi,

Reply to my own question,

It seems it can be done with the .printer class

My problem was as per many examples I was trying to open acDesign, which is NOT allowed in /runtime or .mde

It seems if opened Preview, the margins etc (& all) can be adjusted.

Only tested briefly but done seem to work.

Thanks for making me re-think
 

Users who are viewing this thread

Back
Top Bottom