Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Acccess 97 visual basic

Status
Not open for further replies.

swaimdw

Programmer
Jan 31, 2003
17
US
Is there a way to verify a valid drive path or address prior to attempting to make a new directory (MkDir). The CurDir function appears to have problems even identifying the current drive in Access 97 and app.path does not function with 97.
 
I use the following in both Excel & Access 97 with success.

Dim MyPath As String
' Step 1
MyPath = "c:\TekTips"
If Dir(MyPath, vbDirectory) = "" Then MkDir MyPath

' Step 2
MyPath = MyPath & "\Forum"
If Dir(MyPath, vbDirectory) = "" Then MkDir MyPath


You need to build up the directory structure from the start so you can't go straight to step2.

Hope this helps

[sunshine]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top