I have been experimenting with the new Printer object in Access 2002
and discovered some unexpected database bloat. Simply assigning the
same value to a property of a report's Printer object will cause the
database to grow. Here's my test code:
Public Sub ChangeReportSettings( _
sReport As String, _
sDeviceName As String, _
Optional nIterations As Long = 1)
Dim rpt As Report
Dim i As Long
For i = 1 To nIterations
DoCmd.OpenReport sReport, acViewPreview
Set rpt = Reports(sReport)
rpt.Printer = Application.Printers(sDeviceName)
rpt.Printer.Orientation = acPRORLandscape
DoCmd.Close acReport, sReport, acSaveYes
Next i
End Sub
I thought some growth would be understandable if, for example, the
report's printer is changed from the default to a specific printer.
However, after the first iteration there really should be no change to
the report. It's not about changing the printer either. I commented
that line out and the database still grows just by setting the print
orientation over and over. What's going on here? Any ideas?
Rick Collard
www.msc-lims.com