jfriedrich
Programmer
While working in Access 2003, it would appear that you lose your printer settings in reports periodically. Since this wreaks havoc on our users printing legal size reports, I am working on setting up the printer settings in VBA.
My code is simple and works to print:
dblRptWidth = prptReport.Width + prptReport.Printer.BottomMargin + prptReport.Printer.TopMargin + prptReport.Printer.LeftMargin + prptReport.Printer.RightMargin
Select Case dblRptWidth
Case dblRptWidth > 12240 And dblRptWidth < 15850
prptReport.Printer.PaperSize = acPRPSLetter
prptReport.Printer.Orientation = acPRORLandscape
Case dblRptWidth <= 12240
prptReport.Printer.PaperSize = acPRPSLetter
prptReport.Printer.Orientation = acPRORPortrait
Case Else
prptReport.Printer.PaperSize = acPRPSLegal
prptReport.Printer.Orientation = acPRORLandscape
End Select
This code is fired on Open of the report, and prints okay, but the preview is wrong. To correct the print preview, you must click File, Page Setup, Ok.
Does anyone know of a way to redraw or refresh the preview??
Thanks.
My code is simple and works to print:
dblRptWidth = prptReport.Width + prptReport.Printer.BottomMargin + prptReport.Printer.TopMargin + prptReport.Printer.LeftMargin + prptReport.Printer.RightMargin
Select Case dblRptWidth
Case dblRptWidth > 12240 And dblRptWidth < 15850
prptReport.Printer.PaperSize = acPRPSLetter
prptReport.Printer.Orientation = acPRORLandscape
Case dblRptWidth <= 12240
prptReport.Printer.PaperSize = acPRPSLetter
prptReport.Printer.Orientation = acPRORPortrait
Case Else
prptReport.Printer.PaperSize = acPRPSLegal
prptReport.Printer.Orientation = acPRORLandscape
End Select
This code is fired on Open of the report, and prints okay, but the preview is wrong. To correct the print preview, you must click File, Page Setup, Ok.
Does anyone know of a way to redraw or refresh the preview??
Thanks.