I'm trying to automate the creation of a report called TimeSheet this code does create the pdf file as desired but
it requires input from the user because the Save As dialog box pops up. Is there anyway to tell the Save As dialog box the file name and location to save through code?
Dim NewPrinter
Dim prtDefault
Set prtDefault = Application.Printer
NewPrinter = "PDF Writer"
Set Application.Printer = Application.Printers(NewPrinter)
stDocName = "TimeSheet"
DoCmd.OpenReport stDocName, acViewNormal
Set Application.Printer = prtDefault
"There is no pleasure in having nothing to do; the fun is having lots to do and not doing it.
." - Andrew Jackson
it requires input from the user because the Save As dialog box pops up. Is there anyway to tell the Save As dialog box the file name and location to save through code?
Dim NewPrinter
Dim prtDefault
Set prtDefault = Application.Printer
NewPrinter = "PDF Writer"
Set Application.Printer = Application.Printers(NewPrinter)
stDocName = "TimeSheet"
DoCmd.OpenReport stDocName, acViewNormal
Set Application.Printer = prtDefault
"There is no pleasure in having nothing to do; the fun is having lots to do and not doing it.
." - Andrew Jackson