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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Path/File access error 1

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Sep 6, 2007
418
BE
Hey everyone,

Code:
If Dir(strMap) <> "" Then
    Else
        MkDir strMap
    End If

I create a new map every day with a name the day of today 20071126.

He should check if the map already exist and I do this with the code above.

While testing he produce the error '75' Path/File access error. What can be wrong and how should I improve my code eventually ?
 
Does the variable "strMap" include a full path to the variable?

(eg C:\Documents and Settings\Username\My Documents\20071126)

John
 

Dir Function 's attributes, if omitted, return files that match pathname but have no attributes.

Maybe you need

Dir(strMap, vbDirectory)
 
can it be hard coded something like this

Code:
Dir("20071126","D:\")

I do some tests
 
thanxs Jerry,

Its a small tip but the correct answer to this question.
This works,

Code:
Dir(strMap, vbDirectory)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top