I sure hope you understand this
Checks if a folder exists on the drive
code:
Private Sub Form_Load()
DoesFolderExist "C:\My Test Folder", True
End Sub
Public Function DoesFolderExist(strPath As String, Optional blnCreateFolder As Boolean = False) As Boolean
On Error GoTo e:
ChDir strPath
DoesFolderExist = True
Exit Function
e:
If blnCreateFolder = True Then
MkDir strPath
End If
DoesFolderExist = False
End Function
Checks if a file exists and it not creates it
code:
Private Sub Form_Load()
DoesFileExist "C:\My Test Folder\test.txt", True
End Sub
Public Function DoesFileExist(strFile As String, Optional blnCreateFile As Boolean = False) As Boolean
On Error GoTo e:
FileLen (strFile)
DoesFileExist = True
Exit Function
e:
If blnCreateFile = True Then
Open strFile For Append As #1
Close #1
End If
DoesFileExist = False
End Function