Solved Ms Access Run-time error 2501

Are you looking for fix the MS Access Run-time error 2501? In this post I’ll show you how to fix the problem and handle this error. Basically this error shows when you apply a button for open a form or report by VBA or Micros. Most of new Ms Access developer confused when they can’t fix the error. Don’t worry I’ll give you the 100% solution to fix this error. Let’s see the process.

ms access run time error 2501

Run-time error 2501

  • First go to the button  properties where you have applied click event( Other event)
  • Now open the VBA and apply the code given below
  • Private Sub Command1_Click()
    On Error GoTo Err_Command1_Click
        DoCmd.OpenForm "myForm"
        Exit Sub
        MsgBox Err.Description
        Resume Exit_Command1_Click
    End Sub
  • NB : please replace all of the orange color code according to green color code (Command1_Click). Here Command1 is your button name and _click is your event name

Finished! Now save your code and try it. I think your problem has solved successfully.

Share on :

One Response to “Solved Ms Access Run-time error 2501”

  1. says:

    I needed to know that. Thank is to you for that. I am now going to apply this.

Leave a Reply

two + 2 =