با سلام و تشکر و عرض خسته نباشید.
فايل ها موجود در 'yourfolderName يک پوشه دلخواه را بررسي مي کند و در صورت yourFileName وجود فايل دلخواه پيغام مناسب مي دهد.(در access 2007)
yourfolderName = "c:\"
yourFileName = "1234567890.txt"
Dim yfs, yf, yf1, yfc, ys
Set yfs = CreateObject("Scripting.FileSystemObject")
Set yf = yfs.GetFolder(yourfolderName)
Set yfc = yf.Files
Dim whatnamefile As String
For Each yf1 In yfc
whatnamefile = yf1.name
If whatnamefile = yourFileName Then
isfound = True
Exit For
Else
isfound = False
End If
whatnamefile = ""
Next
If isfound = True Then
MsgBox "I found the file."
Else
MsgBox "I can not found the file."
End If