Solved

Access unexpected error 53: File not found

Posted on 2013-06-21
2
634 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

729 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