The following code works perfectly in Access 2000 thru 2003:
The mdb is in Access 2000.
Important to note that the report has to be opened in design view to set these properties.
Normally the code requires no user intervention.
When the code is ran on Acess 2007 / Vista Business, it stops at DoCmd.OpenReport, leaving
the report open in design view and not continuing code execution. Also, I cannot ctrl + break
to get into debug. I am new to both Acc2K7 & Windows Vista.
Anyone know what might be going on here? The mdb is added to the trust center, so I don't
think that is the problem.
Ever notice how fast Windows runs? Me neither.
Code:
'strReportCode is Dimmed & assigned earlier
Public prt As Printer
DoCmd.OpenReport strReportCode, acViewDesign
Set prt = Reports(strReportCode).Printer
prt.Duplex = acPRDPSimplex
prt.Orientation = acPRORLandscape
prt.PaperBin = 3
DoCmd.PrintOut
DoCmd.Close ObjectType:=acReport, ObjectName:=strReportCode, Save:=acSaveYes
Set prt = Nothing
Important to note that the report has to be opened in design view to set these properties.
Normally the code requires no user intervention.
When the code is ran on Acess 2007 / Vista Business, it stops at DoCmd.OpenReport, leaving
the report open in design view and not continuing code execution. Also, I cannot ctrl + break
to get into debug. I am new to both Acc2K7 & Windows Vista.
Anyone know what might be going on here? The mdb is added to the trust center, so I don't
think that is the problem.
Ever notice how fast Windows runs? Me neither.