I tried posting this question in other places and so far no answers that can help me, so here it goes so far I managed to put this code:
Private Sub Command17_Click()
Me.Refresh
Dim stDocName As String
stDocName = "admin_rptOperator Log"
DoCmd.OutputTo acReport, stDocName, acFormatPDF, "L:\Operations\Team Managers\" & DatePart("yyyy", Date_of_Log) & " Operator Log\ " & Employee_Name & ".pdf"
Exit_Command17_Click:
Exit Sub
Err_Command17_Click:
MsgBox Err.Descriptionq
Resume Exit_Command17_Click
End Sub
I have 1 issue/ 1 questions:
issue 1- the code works great, it saves the file withthe employee name to the correspondent folder (2012 etc..) issue here is if on my form i input something from this year (2012) it saves it great but it also saves everything from 2011 on the same file (employee_name.pdf with all his records from past and present year) all i want to accomplish is for it to save the files from 2011 on the 2011 folder and 2012 on its folder with the same employee name but different year records.
questions: is there a way that i can add something to the current code above that will make MS Access create a folder automatically with the employee name and save the employee file inside with his record ( that way seems easy for me because i can have access save the employee record with the file id at the end on its own folder as individual files)
so far I tried
Dim STRPATH As String
STRPATH = "L:\Operations\Team Managers\" & DatePart("yyyy", Date_of_Log) & " Operator Log\ " & Me.Employee_Name
If Dir(STRPATH, vbDirectory) = "" Then MkDir (STRPATH)
whic creates the folder with the current employee name but the output file does not save inside that folder. It saves it here "L:\Operations\Team Managers\" & DatePart("yyyy", Date_of_Log) & " Operator Log\
any help will be appreciated.