Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Aug 2005
    Thanked 0 Times in 0 Posts

    avoid a runtime error (Access 2000)

    Can i avoid the appearance of the Run time error 2105?

    I have a function that performs well,but at the end
    the Run time error 2105 appears :" You cant go to the

    specified record"

    However when i click "End" on the window, i go to the

    desired place and my function will be perfect if i can

    perform the action of the button "End".

    My question is, is there a function that overlooks a given run time error, for example RunTime error 2105 or 2766.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: avoid a runtime error (Access 2000)

    You can create an On Error handler:

    Sub SomethingOrOther()
    On Error GoTo ErrHandler

    ' your code

    Exit Sub

    Select Case Err
    Case 2105, 2766
    ' Ignore, just continue
    Resume Next
    Case Else
    ' Inform user and get out
    MsgBox Err.Description, vbExclamation
    Resume ExitHandler
    End Select
    End Sub

    But in many cases, it's better to try to find out why the error occurs, and to avoid the error.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts