S
Spacy Mike
When I run an Access 2007 vba that prints several reports to a printer or
outPutTo a PDF or or both, I get error 2501 with using the 4th, or so either
outPutTo or PrintTo. The first few outPutTo or PrintTo work, then I get this
error. At the same point. Cancel is never clicked, the pc is left alone while
vba is running. All search & help says somebody clicked cancel while
outputing or printing, but that is not the case. I don't care about error
catching, because that still not create the printouts of PDF's.
This only happens on one pc. The other pc (where I mostly designed the
Access code) works perfectly.
Here are a few lines of the code:
=============
'PC Report
If Forms![Print all Reports for this Job]![ckPrintPCB] Then
DoCmd.OpenReport (Me.PcReportName), acViewReport, , , ,
NullToString(Me.ReportDate)
If mPrint Then DoCmd.PrintOut acPrintAll
If mPDF Then DoCmd.OutputTo acOutputReport, Me.PcReportName,
acFormatPDF, mReportsPath & "\PC Supplement.PDF"
DoCmd.Close acReport, Me.PcReportName ', acSaveNo
End If
'Metals Report
If Forms![Print all Reports for this Job]![ckPrintMetals] Then
DoCmd.OpenReport (Me.MetalsReportName), acViewReport, , , ,
NullToString(Me.ReportDate)
If mPrint Then DoCmd.PrintOut acPrintAll
If mPDF Then DoCmd.OutputTo acOutputReport, Me.MetalsReportName,
acFormatPDF, mReportsPath & "\Metals Supplement.PDF"
DoCmd.Close acReport, Me.MetalsReportName ', acSaveNo
End If
===================
The first few reports work prior to the above code, as does the PC report
(as the above code). Then when it attempts the Metals report, it errors 2501
everytime on this one particular PC.
I tried commenting out some of the code, and let it do the outPutTo only,
same result. On the pc where this Access works without errors, it can handle
several outputTo & PrintTo's at a time.
Both PC's have Office 2007 trial version. They also have Office 97. I am
trying to get Access 97 converted to 2007 before we upgrade all the pc's with
2007. I accidentally installed Access 2007 runtime after the Office 2007
installation. I remove Office 2007 and reinstalled from scratch, and ran
updates, to see if that would fix the problem, but it didn't.
outPutTo a PDF or or both, I get error 2501 with using the 4th, or so either
outPutTo or PrintTo. The first few outPutTo or PrintTo work, then I get this
error. At the same point. Cancel is never clicked, the pc is left alone while
vba is running. All search & help says somebody clicked cancel while
outputing or printing, but that is not the case. I don't care about error
catching, because that still not create the printouts of PDF's.
This only happens on one pc. The other pc (where I mostly designed the
Access code) works perfectly.
Here are a few lines of the code:
=============
'PC Report
If Forms![Print all Reports for this Job]![ckPrintPCB] Then
DoCmd.OpenReport (Me.PcReportName), acViewReport, , , ,
NullToString(Me.ReportDate)
If mPrint Then DoCmd.PrintOut acPrintAll
If mPDF Then DoCmd.OutputTo acOutputReport, Me.PcReportName,
acFormatPDF, mReportsPath & "\PC Supplement.PDF"
DoCmd.Close acReport, Me.PcReportName ', acSaveNo
End If
'Metals Report
If Forms![Print all Reports for this Job]![ckPrintMetals] Then
DoCmd.OpenReport (Me.MetalsReportName), acViewReport, , , ,
NullToString(Me.ReportDate)
If mPrint Then DoCmd.PrintOut acPrintAll
If mPDF Then DoCmd.OutputTo acOutputReport, Me.MetalsReportName,
acFormatPDF, mReportsPath & "\Metals Supplement.PDF"
DoCmd.Close acReport, Me.MetalsReportName ', acSaveNo
End If
===================
The first few reports work prior to the above code, as does the PC report
(as the above code). Then when it attempts the Metals report, it errors 2501
everytime on this one particular PC.
I tried commenting out some of the code, and let it do the outPutTo only,
same result. On the pc where this Access works without errors, it can handle
several outputTo & PrintTo's at a time.
Both PC's have Office 2007 trial version. They also have Office 97. I am
trying to get Access 97 converted to 2007 before we upgrade all the pc's with
2007. I accidentally installed Access 2007 runtime after the Office 2007
installation. I remove Office 2007 and reinstalled from scratch, and ran
updates, to see if that would fix the problem, but it didn't.