hi I would like to be able to save this form in PDF Format with a file name from the ARNO ie file no 7 . I would like it to goto my documents into a folder that's name comes from the field " company" as this is variable, thanks steve
Private Sub Command436_Click()
Dim FILENAME As String
Dim FALEPATH As String
Dim COMPANY1 As String
Dim company2 As String
If company = 1 Then
FILENAME = "ARNO" & " " & Me.ARNO
filepath = "C:\Users\steve\Documents\ppi" & FILENAME & ".pdf"
DoCmd.OutputTo acOutputQuery, "Individual ARNO", acFormatPDF, filepath
If company = 2 Then
FILENAME = "ARNO" & " " & Me.ARNO
filepath = "C:\Users\steve\Documents\API" & FILENAME & ".pdf"
DoCmd.OutputTo acOutputQuery, "Individual ARNO", acFormatPDF, filepath
End If
MsgBox " file has been saved "
', vbInformation, "save confirmed"
End If
End Sub
Private Sub Command436_Click()
Dim FILENAME As String
Dim FALEPATH As String
Dim COMPANY1 As String
Dim company2 As String
If company = 1 Then
FILENAME = "ARNO" & " " & Me.ARNO
filepath = "C:\Users\steve\Documents\ppi\" & FILENAME & ".pdf"
DoCmd.OutputTo acOutputQuery, "Individual ARNO", acFormatPDF, filepath
If company = 2 Then
FILENAME = "ARNO" & " " & Me.ARNO
filepath = "C:\Users\steve\Documents\API\" & FILENAME & ".pdf"
DoCmd.OutputTo acOutputQuery, "Individual ARNO", acFormatPDF, filepath
End If
MsgBox " file has been saved "
', vbInformation, "save confirmed"
End If
Application.FollowHyperlink Replace$(filepath, Dir$(filepath), "")
End Sub
Private Sub Command437_Click()
Dim FILENAME As String
Dim filepath As String
Dim varFolder As Variant
FILENAME = "ARNO" & " " & Me.ARNO
If Forms![Issue LIST]![company] = "1" Then
DoCmd.OutputTo acOutputReport, "individual arno1", acFormatPDF, "c:\users\steve\documents\all action request reports\ppi action request\" & FILENAME & " .pdf"
End If
If Forms![Issue LIST]![company] = "2" Then
DoCmd.OutputTo acOutputReport, "individual arno1", acFormatPDF, "c:\users\steve\documents\all action request reports\api action requests\" & FILENAME & " .pdf"
End If
If Forms![Issue LIST]![company] = "3" Then
DoCmd.OutputTo acOutputReport, "individual arno1", acFormatPDF, "c:\users\steve\documents\all action request reports\apic action requests\" & FILENAME & " .pdf"
End If
If Forms![Issue LIST]![company] = "4" Then
DoCmd.OutputTo acOutputReport, "individual arno1", acFormatPDF, "c:\users\steve\documents\all action request reports\temp action requests\" & FILENAME & " .pdf"
End If
End Sub
filepath |
---|
"c:\users\steve\documents\all action request reports\ppi action requests\" & FILENAME & " .pdf" |
Private Sub Command438_Click()
Dim FILENAME As String
Dim strFullPath As Variant
Dim folderpath As Variant
Dim foldername As String
FILENAME = "ARNO" & " " & Me.ARNO
Dim varfolder As String
If company = 1 Then company = "PPI-Engineering"
End If
If company = 2 Then company = "API-Engineering"
End If
If company = 3 Then company = "API-Capacitors"
End If
If company = 3 Then company = "temp"
End If
varfolder = DLookup("filepath", "company")
varfolder1 = varfolder & "\" & company & "\" & FILENAME & ".pdf"
Me.Dirty = False
DoCmd.OutputTo acOutputReport, "INDIVIDUAL ARNO", acFormatPDF, varfolder1
End Sub