Changing Page Size settings in VBA

Gezza

Registered User.
Local time
Tomorrow, 08:15
Joined
Jun 19, 2009
Messages
53
Hi,

Can anyone give me some code that changes Report Page Size settings in VBA code

Thanks
 
are you talking about screen resolution or margin changes?


the margins are properties of the report object (I think)
 
Its Page Size I am trying to change from A4 to A3 for example
 
When you set up a report that requires A3 paper you need to specify the printer to used, even if it is the default printer and also specify the paper size. So when Access runs the report it will work with the settings specified.

David
 
Thanks for your response,

What you suggest is true and I can set the printer settings up that way, but for my particular application I need to be able to set the printer settings using code each time the application is run.

Gezza
 
That's a bit like retuning your TV everytime you switch it on. Why the need to do so?
 
Hi, Thanks for your response,
It's a bit complicated but I'll try to explain. The Access file is on a shared network which is used by multible users. Every time the user runs the file it creates a local copy on there PC from the "master" on the network drive. This allows updates of the file to be issued automatically every time the user opens the file. The downside is, and here lies the problem I think, is the the printer settings are saved with the developers PC which do not corresponed with the other network PC's which means each user has to reset some printer settings manually everytime they open the file. Hope this makes sense
 
Hi, Thanks for your response,
It's a bit complicated but I'll try to explain. The Access file is on a shared network which is used by multible users. Every time the user runs the file it creates a local copy on there PC from the "master" on the network drive. This allows updates of the file to be issued automatically every time the user opens the file. The downside is, and here lies the problem I think, is the the printer settings are saved with the developers PC which do not corresponed with the other network PC's which means each user has to reset some printer settings manually everytime they open the file. Hope this makes sense

hm. maybe a solution would be (and i've never done this before, it's just a thought) - to let each user have an extra "local" backend with their specific system settings - like printers, and, i dunno, other things that might be individual preferences or other? what do the gurus think?
 
Code:
[FONT=Courier New]Do you have:[/FONT]
[FONT=Courier New]  o    [B]One file that is shared by multiple users?[/B][/FONT]
 
[FONT=Courier New]       [COLOR=green][B]Split the database into an FE/BE structure, and place[/B][/COLOR] [/FONT]
[FONT=Courier New]       [COLOR=green][B]a copy of the Front End on each User's WorkStation.[/B][/COLOR][/FONT]
 
[FONT=Courier New]  o    [B]A single front end that overwrites the one currently[/B] [/FONT]
[FONT=Courier New]       [B]on the user's desktop each time it is run?[/B][/FONT]
 
[FONT=Courier New]       [COLOR=green][B]Search the Forum for instructions for using one of[/B][/COLOR] [/FONT]
[FONT=Courier New]       [B][COLOR=green]the Front End Auto Updateing Procedures that are[/COLOR][/B][/FONT]
[FONT=Courier New]       [COLOR=green][B]available.  That way the users will only update their[/B][/COLOR] [/FONT]
[FONT=Courier New]       [B][COLOR=green]version if the Front End has changed.[/COLOR][/B][/FONT]
 
Last edited:
MSAccessRookie - sounds like the OP already has this in place.

their issue seems to be that when the FE is overwritten on auto-update, the printer settings the user had are also overwritten.

i don't know if an extra "preferences" or "settings" backend that is kept locally would fix the issue, but it's an idea.
 
MSAccessRookie - sounds like the OP already has this in place.

their issue seems to be that when the FE is overwritten on auto-update, the printer settings the user had are also overwritten.

i don't know if an extra "preferences" or "settings" backend that is kept locally would fix the issue, but it's an idea.

I am not sure that I was clear enough about what I meant. Most of the FE Updaters that I have seen offered here will only update if the FE has changed. I have to believe that the OP is not changing the FE Every day, and if they are, that their Application is not yet user ready. On the other hand, the link that the users select could be a script that copies their FE from a secure area to the user desktop. I was just trying to clarify.
 
"A single front end that overwrites the one currently
on the user's desktop each time it is run?"
"On the other hand, the link that the users select could be a script that copies their FE from a secure area to the user desktop."

Yes this is what is happening. Updates have been frequent during the development stage, "found lots of bugs", but now is only for some improvements. However there are some 15 PC's in the system that need to have the print settings set for each one each time an improvement is introduced. It a big job! Coding that sets printer settings each time the file is deployed makes it a lot easier
 
might this help?

directly from F1 in VBA editor (access help):
Access Developer Reference Printer.PaperSize Property
Returns or sets an AcPrintPaperSize constant indicating the paper size to use when printing. Read/write. Syntax
expression.PaperSize
expression A variable that represents a Printer object.
Example

The following example sets a variety of printer settings for the form specified in the strFormname argument of the procedure.
Visual Basic for Applications Sub SetPrinter(strFormname As String)

DoCmd.OpenForm FormName:=strFormname, view:=acDesign, _
datamode:=acFormEdit, windowmode:=acHidden

With Forms(form1).Printer

.TopMargin = 1440
.BottomMargin = 1440
.LeftMargin = 1440
.RightMargin = 1440

.ColumnSpacing = 360
.RowSpacing = 360

.ColorMode = acPRCMColor
.DataOnly = False
.DefaultSize = False
.ItemSizeHeight = 2880
.ItemSizeWidth = 2880
.ItemLayout = acPRVerticalColumnLayout
.ItemsAcross = 6

.Copies = 1
.Orientation = acPRORLandscape
.Duplex = acPRDPVertical
.PaperBin = acPRBNAuto
.PaperSize = acPRPSLetter
.PrintQuality = acPRPQMedium

End With

DoCmd.Close objecttype:=acForm, objectname:=strFormname, _
Save:=acSaveYes
End Sub
 

Users who are viewing this thread

Back
Top Bottom