I want to post first and foremost, I am not a programmer. Our company recently updated our microsoft access database from 2013 to 2016. We were told they will no longer support it. I keep getting an error on the following code since the update "Error 91 due to incorrect With Statement or Object Not Defined". I completed some research on-line and found out Access 2016 does not use Application.FileSearch, but I do not know what to use as the new replacement coding. The End With statement may not be closing right. Everything else appears to work in the database except this VBA section

This code was written to merge a word document originally from Microsoft Access. Any Assistance is much appreciated to correct this code.

Dim finddoc As Stringfinddoc = Mid(Forms![fFacInsp01]![fFacInspSetup01].Form![ipPermNo], 3, 5) & Mid(Forms![fFacInsp01]![fFacInspSetup01].Form![ipPermNo], 9, 3) & Mid(Forms![fFacInsp01]![fFacInspSetup01].Form![ipPermNo], 13, 2) & " " & Mid(Forms![fFacInsp01]![fFacInspSetup01].Form![ipARMS#], 6, 3) & ".doc"
Dim CR
CR = Chr(13)
On Error GoTo dfLettersPInspError
With Application.FileSearch
    .NewSearch
    .LookIn = pubPermitDocFolder  'a constant in GenMods module
    .SearchSubFolders = False
    .FileName = finddoc
    .MatchTextExactly = True
    .FileType = msoFileTypeWordDocuments
    If .Execute() > 0 Then
        pubCopyPermitDoc = finddoc
    Else
        pubCopyPermitDoc = Null
        MsgBox ("An electronic version of the permit conditions is not available." & CR & "Please see your supervisor about creating one, or using an" & CR & "existing inspection format.")
        Exit Sub
    End If
End With
DoTheMerge:
Call dmerge(WordDoc, MergeQuery, SaveFolder)
Exit Sub
dfLettersPInspError:
MsgBox ("error # " & Err.Number & Err.Description)
Resume Next
End Sub