Sam Summers
Registered User.
- Local time
- Today, 00:37
- Joined
- Sep 17, 2001
- Messages
- 939
Hi guys,
I am nearly there with this but cant quite get the last bit done.
The two separate sections work i.e. the file location opens and the file save section works well too but I want to allow the user to simply choose the location for the file as named already.
Many thanks in advance
I am nearly there with this but cant quite get the last bit done.
The two separate sections work i.e. the file location opens and the file save section works well too but I want to allow the user to simply choose the location for the file as named already.
Code:
Private Sub TOMainPdf_Click()
On Error GoTo TOMainPdf_Click_Err
Dim MyPath As String
Dim MyFilename As String
Dim f As Object
Set f = Application.FileDialog(msoFileDialogFilePicker)
Dim varFile As Variant
f.Show
With f
.AllowMultiSelect = False
For Each varFile In .SelectedItems
MsgBox varFile
Next varFile
End With
Me.JobNo.SetFocus
MyPath = "C:\Users\Sam Summers\Documents\Work Databases\Hatch\"
MyFilename = Me.JobNo.Text & "-" & "Transocean Main Rpt" & "-" & Day(Now) & "-" & Month(Now) & "-" & Year(Now) & ".pdf"
DoCmd.OutputTo acOutputReport, "TransoceanMainRpt", acFormatPDF, MyPath & MyFilename, False
TOMainPdf_Click_Exit:
Exit Sub
TOMainPdf_Click_Err:
MsgBox Error$
Resume TOMainPdf_Click_Exit
End Sub
Many thanks in advance