Checking for the Existance of a file including subdirectories -
04-05-2004
, 04:40 AM
Hello!
How I can check the existance of the file including subdirectories.
I'm using following code that is working fine for given folder.
Option Compare Database
Public Function adhFileExists(strName As String) As Boolean
On Error Resume Next
Dim strTemp As String
strTemp = Dir(strName)
adhFileExists = ((Len(strTemp) > 0) And (Err.Number = 0))
End Function
Private Sub Command0_Click()
Dim FileName As String
FileName = "c:\" & Forms![FindFile]![SNUM] & ".pdf"
MsgBox FileName
If adhFileExists(FileName) Then
MsgBox "OK!"
End If
End Sub
Thank you in advance
David |