I have put the following code in a Access 2003 module. It is to identify each drive in a computer. Now I cannot figure out how to call it from a command button. Any suggestions. Thank you all.
Public Function DExists(OrigFile As String)
Dim fs, d
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.driveexists(OrigFile) = True Then
Set d = fs.getdrive(OrigFile)
DExists = 1
If d.isready = True Then
DExists = 2
Exit Function
End If
Else
DExists = 0
End If
End Function
Public Function DExists(OrigFile As String)
Dim fs, d
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.driveexists(OrigFile) = True Then
Set d = fs.getdrive(OrigFile)
DExists = 1
If d.isready = True Then
DExists = 2
Exit Function
End If
Else
DExists = 0
End If
End Function