I am trying to automatically export a report to PDF from a function/macro in Access 2000.
When I run the following code I get this error message:
"Server has not yet been opened."
When I click "Debug" the program hi-lights the last line of my code: rep.Export False
CODE:
Public Function ExportToPDF()
Dim appl As New CRAXDRT.Application
Dim rep As CRAXDRT.Report
Set rep = appl.OpenReport("\\File-Server\MyReport.rpt", 1)
rep.ExportOptions.DiskFileName = "\\Outfile\MyReport.pdf"
rep.ExportOptions.DestinationType = crEDTDiskFile
rep.ExportOptions.FormatType = crEFTPortableDocFormat
rep.Export False
End Function
Do I need another line of code that makes the connection to the server or is there something I need to change on the report that will make the connection to the server at runtime?
ANY HELP WILL BE GREATLY APPRECIATED...
Thanks.
Mark
When I run the following code I get this error message:
"Server has not yet been opened."
When I click "Debug" the program hi-lights the last line of my code: rep.Export False
CODE:
Public Function ExportToPDF()
Dim appl As New CRAXDRT.Application
Dim rep As CRAXDRT.Report
Set rep = appl.OpenReport("\\File-Server\MyReport.rpt", 1)
rep.ExportOptions.DiskFileName = "\\Outfile\MyReport.pdf"
rep.ExportOptions.DestinationType = crEDTDiskFile
rep.ExportOptions.FormatType = crEFTPortableDocFormat
rep.Export False
End Function
Do I need another line of code that makes the connection to the server or is there something I need to change on the report that will make the connection to the server at runtime?
ANY HELP WILL BE GREATLY APPRECIATED...
Thanks.
Mark