var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
I got a report designed for A3 paper size.
Every time I change the design, I have to set my default printer to one which has A3 paper, so that the A3 paper size setting does not get altered.
But when I send the database to someone else, the paper size will be reset to A4 (probably because his Default printer has NO A3).
How can I FIX the paper size of that report to A3 ??
Is there any VBA solution ?
It is not a good idea to fix it to A3, cause then an user without an A3 cannot print at all. Anyway it isn't possible to fix it because Access always trys to fit it to the printer (same as any other windows program).
But there is a property that might do what you want. You can disable the standardprinter for your report:
reports(YOURREPORT).UseDefaultPrinter = false
Put this in the function who opens the reoport, or in the OnOpenEvent.
I understand your concept of flexibility.
But in my case, there is no point to make it flexible.
Because that report must be printed in A3 size. It is designed for that size. It won't fit in A4.
I do not want to fix the printer name, but I do want to fix the paper size (to A3).
So, can anybody help again ???
You can't set up the page size of a report, as well as can't do this in Word or Excel. But you can prevent Access from automatically resize the report by using the piece of code i gave you.
Re: Gurus , where have you gone ??
There must be a programmatic way to do this.
Gurus ! Where have you all gone ??
Gurus, where are you all hiding ??
Actually, if you do the sp update for access 2k you shouldn't have a problem. I have found that quite a few printing bugs exist in access 2k and the patch seems to fix all I have found.
Using Access 97
But I using Access 97...What about Access 97?
since you admit the possibility that a remote user will not have an A3 printer, whatever solution you find is really only for viewing the report.
viewing is done on a screen not on a printer, so the real problem is scaling the report to fit screen width (or to sideways-scroll on a larger than screen width) ...and that is right where HTML lives.
?? write it all out manually as HTML?
strHTML = "<html><head><title>whatever</title></head><body>"
strHTML = strHTML & "<table width=""100%"">" ' or 200% or 400% or?
strHTML = strHTML & etc etc etc etc
it's really boring to set up, but once done, you have a report that is completely under your control and adapts to viewing on any machine.
printing? you are no worse off than before with a user who has no A3 printer.
The user DOES have a A3 printer.
But his PC's default printer might not have.
So, when he opens the report, the A3 size setting will be gone.
(Only when he prints it then he chooses the printer)
Try this I use it to set the printer for different department depending on log in. It will need some alterations to fit your requirements.
Private Sub cmdPrint_Click()
Dim stDocName As String
Dim prtDefault As Printer
'Set the printer default
Set Application.Printer = Application.Printers(0) ' This needs to be revised to default printer
Set prtDefault = Application.Printer
'Opens YourReport in preview mode and hides YourForm and then sets the reports printer to above printer
stDocName = "YourReportName"
DoCmd.OpenReport stDocName, acPreview, , , acWindowNormal
Me.Visible = False
Reports(stDocName).Printer = prtDefault
'Set the printer tray for ClinPath Printer
prtDefault.Duplex = acPRDPSimplex 'single sided print
prtDefault.PaperSize = acPRPSA3 'This should set the papersize
I felt excited when I saw your reply. But when I tried out the code, it did
not work. What package is it for ?? It's not for Access.
Yes I use it in an Access XP database (I'll check to see if it works in 97). The Application.Printer is part of the Access library (MSACC.OLB). What part does not work ? It does need some tweeking to fit you requirements.
When I tried to compile, it complained that "Printer" is not a member of
the Application object.
Which version of Access are you using ? Also check which Access library you are referencing.
I'm using Access 97. What extra reference do I need to register ??