[AccessD] A2203: Determine if a folder exists

Darren DICK d.dick at uws.edu.au
Mon Mar 21 22:05:25 CST 2005


Hi all
Found the folder exist method
Still no go
I tried the following code and even if the folder existed or not 
I kept getting false (NOT EXIST)

Dim fs

Set fs = CreateObject("Scripting.FileSystemObject")

    If fs.FolderExists(Me.txtFolderPath) = True Then
        MsgBox "EXIST"
    ElseIf fs.FolderExists(Me.txtFolderPath) = False Then
        MsgBox "NOT EXIST"
    End If 



-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters
Sent: Tuesday, 22 March 2005 2:33 PM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] A2203: Determine if a folder exists

Darren,

FileSystemObjects has a method to tell you if a folder exists.

You'll need to set a reference to scrrun.dll.

Dan Waters
President
ProMation Systems, Inc.
763-780-2496


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK
Sent: Monday, March 21, 2005 9:16 PM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] A2203: Determine if a folder exists

Hi Doris
It looked like it might work
But It tells me the Folder Exists even when I delete it???

If I msgbox the line Len(Dir(me.PathToDownloadTo)) 

It gives me 0 (That's a zero) both before and even after I delete the folder

Any suggestions?

Many thnks

Darren

 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mike & Doris Manning
Sent: Tuesday, 22 March 2005 1:14 PM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] A2203: Determine if a folder exists

If Len(Dir(me.PathToDownloadTo)) > 0 Then
	MsgBox "Folder Doesn't Exist"
Else
	MsgBox "Folder exists"
End If

Doris Manning
Database Administrator
Hargrove Inc.
www.hargroveinc.com


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK
Sent: Monday, March 21, 2005 9:01 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] A2203: Determine if a folder exists


Hello all
This should be simple but it's causing me pain I have a folder (It does
exist) C:\SomeFolder\SomeSubFolder\TheDestination

If I type the following code and 'run' it

If IsNull(Dir(Me.PathToDownloadTo)) Or Dir(Me.PathToDownloadTo) = "" Then
        MsgBox "Folder Doesn't Exist"
    Else
        MsgBox "Folder exists"
    End If

It still tells me the folder doesn't exist even though it does

What is a 'proper' way to tell if a folder exists

Many thanks in advance

Darren


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list