Solved

Access unexpected error 53: File not found

Posted on 2013-06-21
2
631 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Many to Many From without subform 11 48
SQL Server Compression Decision 5 49
Sort order not as I expected 13 21
MS Access VBA For Each Field Designation 3 21
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

696 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