Hi all,
I have below code to save excel file to selected location
I now need to do the same with a PDF file but for some reason I am getting error message on a code I use often
Please could you advise
I have below code to save excel file to selected location
I now need to do the same with a PDF file but for some reason I am getting error message on a code I use often
Please could you advise
Private Sub DeferBtn_Click()
On Error GoTo DeferBtn_Click_Err
Dim StrFileName As String
Dim StrQryName As String
Dim StrSaveFile As String
'DoCmd.SetWarnings False
'DoCmd.SelectObject acModule, "OpenOutlook", False
'DoCmd.OpenQuery "Update Daw Status - Rectification", acViewNormal, acEdit
'DoCmd.OpenQuery "Update Daw Status - Defer", acViewNormal, acEdit
'DoCmd.OpenQuery "Update Defer with Reg", acViewNormal, acEdit
StrFileName = strGetFileFolderName("Defer" & " - Registration -" & " " & Forms![Progress Check List - Defer]![Registration], 2, "Excel")
'Debug.Print StrFileName
StrQryName = "Defer QRY"
If Len(StrFileName & "") < 1 Then
StrFileName = Application.CurrentProject.Path & "\Defer" & Format(Date, "yyyymmdd") & ".xls"
End If
DoCmd.TransferSpreadsheet acExport, 10, StrQryName, StrFileName, True, , True
DeferBtn_Click_Exit:
Exit Sub
DeferBtn_Click_Err:
MsgBox Error$
Resume DeferBtn_Click_Exit
'DoCmd.Close acForm, "Progress Check List - Defer"
'DoCmd.Close acForm, "Menu"
'DoCmd.OpenForm "Menu", acNormal, "", "", , acNormal
'DoCmd.SetWarnings True
End Sub