Update :
I no longer get any sort of error, I used Debug.Print and noticed the MyFileName had a weird character so i Fixed that. The only concern I have is that the filter is not being applied it gives me a pdf file with all the Invoice #'s when I want just the specific Invoice#. This filter works fine when I use for a normal print preview.
I would also like to know how can i set it up so it doesn't keep overwriting the previous file if i output the same invoice# is there a away to add the current time on to the filename???
Here is my new code
Code:
Dim MyFilter As String
Dim MyPath As String
Dim MyFilename As String
MyFilter = [Invoice#] = [Forms]![Job List (New Job) Form]![Invoice#]
Debug.Print MyFilter
MyPath = "C:\TestFolder\" & Format(Me.Client_Name)
Debug.Print MyPath
MyFilename = Format(Me.Job_Date, "yyyy") & _
"-" & Format(Me.Job_Date, "dd") & Format(Me.Job_Date, "mm") & ".pdf"
Debug.Print MyFilename
DoCmd.OpenReport "Final Invoice Report", acViewPreview, , MyFilter
DoCmd.OutputTo acOutputReport, "", acFormatPDF, MyPath & MyFilename, True
DoCmd.Close acReport, "Final Invoice Report"