Hi
I built a little Access database to handle employees in my firm.
This form is used by multiple users and it works as intended except for one single user.
The form contains a button to export the current recordset to a .pdf file using the code
Code:
Private Sub Export_Click() Dim strWhere As String
Dim myPath As String
Dim strReportName As String
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[Seance_ID] = " & Me.[Seance_ID]
DoCmd.OpenReport "Report Employees", acViewPreview, , strWhere
myPath = "C:\Employees\" & Year(Date) & "\" & Month(Date) & " " & MonthName(Month(Date)) & "\"
strReportName = Year(Date) & "-" & Month(Date) & "-" & Day(Date) & ".pdf"
DoCmd.OutputTo acOutputReport, , acFormatPDF, myPath & strReportName, False
DoCmd.Close acReport, "Report Employees"
End If
End Sub
As I already said, the code works perfectly, only one user gets a runtime error 2501 while trying to execute the code.
Does anyone knows a solution for this issue?
Thanks