dbTalk Databases Forums  

Checking for the Existance of a file including subdirectories

comp.database.ms-access comp.database.ms-access


Discuss Checking for the Existance of a file including subdirectories in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David
 
Posts: n/a

Default 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

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.