Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print automation code fails in Acc2K7

Status
Not open for further replies.

genomon

Programmer
Aug 20, 2001
2,449
US
The following code works perfectly in Access 2000 thru 2003:
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
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top