1: 2: 3: 4: 5: 6: 7:
Dim strName As String Dim strFile As String strName = Forms![LookbackInput]![FinalBudID] strFile = "" & strName DoCmd.OutputTo acOutputReport, "LookbackReport", acFormatPDF, "" & strName & "-LookbackReport.pdf", True
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30:
Function SaveToFolder() As String On Error GoTo ErrHandler Dim strFolderPath As String Dim fd As Office.FileDialog Set fd = Application.FileDialog(msoFileDialogFolderPicker) With fd .Title = "Browse for folder" .ButtonName = "Select" .InitialView = msoFileDialogViewDetails If .Show = -1 Then strFolderPath = CStr(fd.SelectedItems.Item(1)) & "\" Else strFolderPath = "" End If End With SaveToFolder = strFolderPath ErrHandlerExit: Exit Function ErrHandler: MsgBox "Error No: " & Err.Number & "; Description: " & Err.Description Resume ErrHandlerExit End Function