Results 1 to 3 of 3
  1. #1
    brinehart is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Location
    California
    Posts
    2

    Handling Error Message when file path does not exsist

    Code:
    StrInput = Me.SearchListbox.Column(1)
        Application.FollowHyperlink StrInput, , True
    When I click on a row in a list box it grabs a url for a file location on my server and opens the location specified, but if the server is down or the url is inncorrect I get an error message "Runtime Error 490 can not find specified file"



    it works when the path is correct how can I display a friend message box stating that the path is incorrect or ignore the error all together?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Add some error-handling code to the procedure
    Code:
    Private Sub YourSub()
    On Error GoTo ErrorHandler
        
        'Your code is here
    Exit_ErrorHandler:
        Exit Sub
    ErrorHandler:
      If err.Number = 490 Then
        MsgBox "Your Msg Here"
      Else
        MsgBox "Error Number " & err.Number & " : " & err.Description
        Resume Exit_ErrorHandler
      End If
      
    End Sub
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    brinehart is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Location
    California
    Posts
    2
    That worked great thanks a bunch!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 03-04-2012, 12:17 AM
  2. Replies: 2
    Last Post: 12-08-2011, 02:27 PM
  3. Error 2501 displays with Error handling
    By agent- in forum Programming
    Replies: 13
    Last Post: 08-05-2011, 02:20 PM
  4. path\file access error 75
    By PRASANNA in forum Programming
    Replies: 2
    Last Post: 04-25-2011, 04:50 AM
  5. parametrize file path
    By ysrini in forum Access
    Replies: 3
    Last Post: 03-01-2010, 09:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums