Dir() can search for folders. The function below provides an example
wrapper.
You will need to pass in a string. To get the username, you might be able to
use:
Environ("username")
or you may prefer to use an API call:
http://www.mvps.org/access/api/api0008.htm
Public Function FolderExists(varPath As Variant) As Boolean
On Error Resume Next
If Len(varPath) > 0& Then
FolderExists = (Len(Dir$(varPath, vbDirectory)) > 0&)
End If
End Function

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Hello,
>
[quoted text clipped - 6 lines]
>
> Daniel
Daniel - 18 Nov 2004 12:59 GMT
I've tried to use an if statement to verify if the directory exist because
the help file explained that the dir function returned "" if the folder did
not exist
if dir("c:\temp")="" then
msgbox "this directory does not exist"
end if
but I can't seem to get it to work.Could you point out my mistake.
Thankyou
Daniel
> Dir() can search for folders. The function below provides an example
> wrapper.
[quoted text clipped - 22 lines]
> >
> > Daniel
Douglas J. Steele - 18 Nov 2004 13:28 GMT
You're missing the second parameter, vbDirectory:
if dir("c:\temp", vbDirectory)="" then
msgbox "this directory does not exist"
end if

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> I've tried to use an if statement to verify if the directory exist because
> the help file explained that the dir function returned "" if the folder did
[quoted text clipped - 38 lines]
> > >
> > > Daniel