I know it rankles some when I say that but let me demonstrate!
I have three drives that are part of the data paths for my system.
Drive "J" is a portable hard drive.
Drive "Y" which is a mapped remote drive.
Drive "Z" Which is a mapped remote drive.
When I run the software in accdb mode access finds all three drives.
When I compile the software and the accde starts automatically, the "J" drive is found but the required folder is not.
The two mapped drives are interrogated successfully.
If I now run the accde file separately all three drives are found.
The problem is that "oFSO.FolderExists(sDrive & "Images")" doesn't find the folder in this instance
I have three drives that are part of the data paths for my system.
Drive "J" is a portable hard drive.
Drive "Y" which is a mapped remote drive.
Drive "Z" Which is a mapped remote drive.
When I run the software in accdb mode access finds all three drives.
When I compile the software and the accde starts automatically, the "J" drive is found but the required folder is not.
The two mapped drives are interrogated successfully.
If I now run the accde file separately all three drives are found.
The problem is that "oFSO.FolderExists(sDrive & "Images")" doesn't find the folder in this instance
Code:
Private Sub getDrives()
' tempvars!drive is any removable drive.
' tempvars!Patha is the network drive that hoalds image files and other documents.
' tempvars!Pathb is the network drive that holds the back-end files and individual front-end files.
Dim sDrive As Object
For Each sDrive In oFSO.Drives
If sDrive.DriveType = 2 And oFSO.FolderExists(sDrive & "Images") Then ' this is the line that fails.
TempVars!Drive = sDrive & "\"
ElseIf sDrive.DriveType = 3 And oFSO.FolderExists(sDrive & "Images") Then
TempVars!PathA = sDrive & "\"
ElseIf sDrive.DriveType = 3 And oFSO.FolderExists(sDrive & "Split") Then
TempVars!PathB = sDrive & "\"
End If
Next
End Sub