MkDir "Path/File error"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gazelle04
    New Member
    • Jul 2006
    • 52

    MkDir "Path/File error"

    I wanted to create a subfolder in a directory and I used the MkDir statement but it gives me an error like "Path/File access error"

    Here are the codes:

    MkDir "\\BC123456\Att achments\" & Me.UniversityID .Value

    BC123456 = shared computer
    Attachments = shared folder
    Me.UniversityID = is a text box on the form with a number format

    I tried to use the Str() function but still it gives me an error. I even tried this:

    Dim strUniversityNo as string
    strUniversityNo = Me.UniversityID
    MkDir "\\BC123456\Att achments\" & strUniversityNo

    But still this doesn't work.


    Please help.
  • PEB
    Recognized Expert Top Contributor
    • Aug 2006
    • 1418

    #2
    Hi,

    Try:

    MkDir "\\BC123456\Att achments\" & Mid(str(Me.Univ ersityID.Value) ,2,len(str(Me.U niversityID.Val ue)))

    Comment

    • PEB
      Recognized Expert Top Contributor
      • Aug 2006
      • 1418

      #3
      Also you can try to add one or two letters before the number!

      And finally something that can work is to map a network drive in Windows Explorer and Assign to this shared computer a letter For exemple Y

      Then create mkdir with the specified letter!

      Some commands don't use the path like \\Server\bla\bl la and are done to search for a drive!

      Have a nice luck!

      Comment

      • LogOff
        New Member
        • Oct 2006
        • 1

        #4
        Check that access to your shared folder is available (folder location and file permissions).

        (don't forget that mkdir instruction allows you to create a single folder at once)

        Comment

        Working...