user picks the file to save to
Code:
sub btnSelectFile_click()
vFile = strFolder & "ThreadStatus " & Tod & ".pdf"
vTarg = SaveAs1(vFile)
If Not IsEmpty(vTarg) Then DoCmd.OutputToacOutputReport, "ReportThreadHeaders", "PDFFormat(*.pdf)",vTarg , False,"", , acExportQualityPrint
end sub
put this code into a MODULE for user to pick the file
Code:
Public Function SaveAs1(ByVal pvDfltFile)
'===================
'YOU MUST ADD REFERENCE : Microsoft Office xx.0 Object Library, in vbe menu, TOOLS, REFERENCES
'===================
With Application.FileDialog(msoFileDialogSaveAs)
.AllowMultiSelect = False
.Title = "Locate a file to Save"
.ButtonName = "Save"
.InitialFileName = pvDfltFile
.InitialView = msoFileDialogViewList 'msoFileDialogViewThumbnail
If .Show = 0 Then
'There is a problem
Exit Function
End If
'Save the first file selected
SaveAs1 = Trim(.SelectedItems(1))
End With
End Function