S
Sietske
myHi all!
I already read a lot of earlier questions on this subject, but the answers
just didn't seem to help in my case. I hope one of you can help me out:
Several persons will have access to my database. When they have added the
network pdf printer (called "PDFCreator") they should be able to print single
records as pdf documents. However, the button I've added to make this
possible, does not work. Literally, it contains the following code:
'****************************
Private Sub btnPrintAlsPDF_Click()
On Error GoTo Err_btnPrintAlsPDF_Click
Dim strDocName As String
Dim strWhere As String
strDocName = "rptMyReport"
strWhere = "[Id_Record]=" & Me!Id_Record
DoCmd.OpenReport strDocName, acViewPreview, , strWhere
Application.Reports(strDocName).Printer =
Application.Printers("PDFCreator")
Exit_btnPrintAlsPDF_Click:
Exit Sub
Err_btnPrintAlsPDF_Click:
MsgBox Err.Description
Resume Exit_btnPrintAlsPDF_Click
End Sub
'****************************
The error occurs in the part Application.Printers("PDFCreator"). It says
"Ongeldige procedure-aanroep of ongeldig argument", which means something
like "invalid call for the procedure, or invalid argument".
Can somebody please tell me what is needed to fix this problem?
I already read a lot of earlier questions on this subject, but the answers
just didn't seem to help in my case. I hope one of you can help me out:
Several persons will have access to my database. When they have added the
network pdf printer (called "PDFCreator") they should be able to print single
records as pdf documents. However, the button I've added to make this
possible, does not work. Literally, it contains the following code:
'****************************
Private Sub btnPrintAlsPDF_Click()
On Error GoTo Err_btnPrintAlsPDF_Click
Dim strDocName As String
Dim strWhere As String
strDocName = "rptMyReport"
strWhere = "[Id_Record]=" & Me!Id_Record
DoCmd.OpenReport strDocName, acViewPreview, , strWhere
Application.Reports(strDocName).Printer =
Application.Printers("PDFCreator")
Exit_btnPrintAlsPDF_Click:
Exit Sub
Err_btnPrintAlsPDF_Click:
MsgBox Err.Description
Resume Exit_btnPrintAlsPDF_Click
End Sub
'****************************
The error occurs in the part Application.Printers("PDFCreator"). It says
"Ongeldige procedure-aanroep of ongeldig argument", which means something
like "invalid call for the procedure, or invalid argument".
Can somebody please tell me what is needed to fix this problem?