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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creation of PDF file no longer working

Status
Not open for further replies.

Saturn57

Programmer
Joined
Aug 30, 2007
Messages
275
Location
CA
I'm getting an error on a print code that use to work. The code basically printed a quote range based on two values inputted in a form. The error I get is:
Run-time error '2212:
Microsoft Office Access couldn't print your object.

The code is as follows and it stops on line (DoCmd.OpenReport "QuotePrintSignedPDF", acViewNormal, , "QuoteNo =" & PrintQuoteNo
)

Private Sub Command15_Click()
Dim CustomerName As Variant

PrintQuoteNo = Me.StartQuoteNo
While (PrintQuoteNo <= Me.EndQuoteNo)
CustomerName = DLookup("[ShortName]", "QuoteData", "[QuoteNo]=" & PrintQuoteNo)
DoCmd.OpenReport "QuotePrintSignedPDF", acViewNormal, , "QuoteNo =" & PrintQuoteNo
DoCmd.Close acReport, "QuotePrint"
FileFound = Dir("\\Server1\common\Sales\Access\Quotes\QuotePrintSignedPDF.pdf")
Do While FileFound = ""
WaitABit
FileFound = Dir("\\Server1\common\Sales\Access\Quotes\QuotePrintSignedPDF.pdf")
Loop
Name "\\Server1\common\Sales\Access\Quotes\QuotePrintSignedPDF.pdf" As "\\Server1\common\Sales\Access\Quotes\" & PrintQuoteNo & CustomerName & ".pdf"
PrintQuoteNo = (PrintQuoteNo + 1)
Wend
End Sub

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top