Solved

Access unexpected error 53: File not found

Posted on 2013-06-21
2
620 Views
Last Modified: 2013-06-26
I have the following code in an onclick event of a label on a form but once in a while the user gets this message:

Access unexpected error 53: File not found

and the user is not directed to the server folder.

Does anyone know what this is all about and perhaps have a solution?


Private Sub Label241_Click()

    'Copied over from frmPartsMasters
    Dim stAppName As String

    On Error GoTo errhand

    stAppName = "C:Windows\explorer.exe \\D5XR1BP1\Company\General Shared Files\PRINTS\" & Me.txtPartN & "\"
    Dim d As Double
    Dim dty As String
    dty = "\\D5XR1BP1\Company\General Shared Files\PRINTS\" & Me.txtPartN
    If Len(Dir("\\D5XR1BP1\Company\General Shared Files\PRINTS\" & Me.txtPartN & "\")) = 0 Then
        MkDir ("\\D5XR1BP1\Company\General Shared Files\PRINTS\" & Me.txtPartN)
        MsgBox "Folder has been created on server.  Remember to place image files in this folder."
    End If

    Call Shell(stAppName, 1)
   
    Exit Sub
errhand:
    If Err.Number = 75 Then
    ' probably directory exists but empty
    ' ignore
    Resume Next
Else
    MsgBox "Unexpected error " & Err.Number & " : " & Err.Description
    Resume Next
End If

Exit_cmdExplore_Click:
    Exit Sub

Err_cmdExplore_Click:
    MsgBox Err.Description
    Resume Exit_cmdExplore_Click

End Sub
0
Comment
Question by:SteveL13
2 Comments
 
LVL 7

Accepted Solution

by:
dec0mpile earned 500 total points
ID: 39266341
You are going to a network share. Sometimes even though users are logged into the domain, shares do not work or credentials do not authenticate (I've seen this behaviour with 2003 domain controllers, but its possible with all editions). Reboot usually fixes this problem. That's probably the reason why sometimes you see file not found error.

Try to replace the name of the server with the IP in all cases and see if that works better.

EX:
Instead of: \\D5XR1BP1\Company\General Shared Files\PRINTS\
Try: \\192.168.0.10\Company\General Shared Files\PRINTS\

Replace 192.168.0.10 with the proper IP
0
 
LVL 45

Expert Comment

by:aikimark
ID: 39267831
Since you have a space in the path name, you need to surround the path with quote characters.  You can do that with a quote character literal in the string (doubled, of course) or concatenate a couple of Chr(34) values into the string.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Display multiple images in report 12 85
Dateadd 3 22
DCount with multiple criteria 3 23
Help with SQl and UNION 7 16
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now