Code:
rivate Sub Command437_Click()
Dim FILENAME As String
Dim strFullPath As Variant
Dim folderpath As Variant
Dim foldername As String
Dim varfolder2 As String
Dim company1 As String
Dim a As String
Dim varfolder As String
If company = 1 Then company1 = "PPI-Engineering"
If company = 2 Then company1 = "API-Engineering"
If company = 3 Then company1 = "API-Capacitors"
If company = 4 Then company1 = "temp"
a = Year(Now)
' FILENAME = "ARNO" & " " & Me.ARNO
varfolder = DLookup("filepath", "company")
FILENAME = Left(company1, 5) & " " & "ARNO" & " " & Me.ARNO
varfolder1 = varfolder & "\" & company1 & "\" & a & "\" & FILENAME & ".pdf"
Me.Dirty = False
DoCmd.OutputTo acOutputReport, "INDIVIDUAL ARNO", acFormatPDF, varfolder1
at present i have a table with a file path " "c:\users\steve\documents\all action request reports. " it then adds the folder to the file path " company1" and then gives me the name of the report . how can it add a yearly folder if it don't exist so the files go into yearly folders
thanks
steve