G
Gwen H
I am attempting to build a module that will print out 15 different reports to
my Acrobat Distiller. In the code below, the first two reports are one page
each. The third report is multiple pages. I need to use the value in one of
the report fields as part of the PDF filename. I am still working on how to
handle the multi-page report, but I don' t even want to address that in this
post. What I want to know is this: Why, when I run the code below, do I get
the error message "Invalid use of the me keyword" ????
Any help you can provide would be greatly appreciated.
Gwen H
Option Compare Database
Option Explicit
Function setPrinterPDF()
Set application.Printer = application.Printers("Acrobat Distiller")
End Function
Function printPSreports()
Dim officerName As String
DoCmd.OpenReport "Product Specialist Worksheet"
officerName = Me.Product_Specialist_Goals_Incentive.Product_Specialist
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.Close
End Function
Function printPBreports()
Dim officerName As String
DoCmd.OpenReport "Private Banking-Relationship Manager"
officerName = Me.Private_Banking_Officer
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.Close
End Function
Function printCBreports()
Dim officerName As String
DoCmd.OpenReport "Commercial Banker Incentive Worksheet-Large Market"
DoCmd.GoToPage 1
officerName = Me.[Commercial Banker Incentive Worksheet-Large
Market.Commercial_Loan_Officer]
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.PrintOut (acPages = 1)
DoCmd.Close
End Function
my Acrobat Distiller. In the code below, the first two reports are one page
each. The third report is multiple pages. I need to use the value in one of
the report fields as part of the PDF filename. I am still working on how to
handle the multi-page report, but I don' t even want to address that in this
post. What I want to know is this: Why, when I run the code below, do I get
the error message "Invalid use of the me keyword" ????
Any help you can provide would be greatly appreciated.
Gwen H
Option Compare Database
Option Explicit
Function setPrinterPDF()
Set application.Printer = application.Printers("Acrobat Distiller")
End Function
Function printPSreports()
Dim officerName As String
DoCmd.OpenReport "Product Specialist Worksheet"
officerName = Me.Product_Specialist_Goals_Incentive.Product_Specialist
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.Close
End Function
Function printPBreports()
Dim officerName As String
DoCmd.OpenReport "Private Banking-Relationship Manager"
officerName = Me.Private_Banking_Officer
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.Close
End Function
Function printCBreports()
Dim officerName As String
DoCmd.OpenReport "Commercial Banker Incentive Worksheet-Large Market"
DoCmd.GoToPage 1
officerName = Me.[Commercial Banker Incentive Worksheet-Large
Market.Commercial_Loan_Officer]
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.PrintOut (acPages = 1)
DoCmd.Close
End Function