In the database saving a lots of files which are differentiate by ID. Same ID could have more than one but different date. Im trying to create the code to retrieve the word document with latest current date:

If FileExist(strFileName) Then
objword.Documents.Open strFileName
Call WordSetting("Protect")
ElseIf FileExist(strNewFileName) Then
Set objTempWord = New Word.Application
objTempWord.Visible = False
'strNewFileName = Format(Date, "MM/DD/YYYY")
'FileExist(strNewFileName)
objTempWord.Documents.Open strNewFileName, "", "", "", "", "", "", "", "", Format(strNewFileNa me, "DD/MMM/YYYY hh:nn:ss", "", vbUseSystem)
Call WordSetting("Protect")

Function for FileExist:

Public Function FileExist(strFileExist As String) As Boolean
On Error GoTo SystemError

Dim fs As Object

Set fs = CreateObject("Scripting.FileSystemObject")

FileExist = fs.FileExists(strFileExist)

Set fs = Nothing

On Error GoTo 0
Exit Function