Error 2501

P

PeterM

I'm running Access 2003. I get a message from Access
saying "Error 2501", The OpenForm action was cancelled".

Does anyone have any idea what this is saying. I can't
find any reference to error number 2501. It happens
prior to the OpenForm event.
 
V

Van T. Dinh

It means you tried to open the Form using the OpenForm
action and there are problems opening the Form. A few
things you can check:

1. Open the Form using the GUI via the Forms container in
the database window and see if the Form opens OK.

2. Check the Form's Module and see if you hace any code
in the Form_Open Event. Then reason is that the opening
of the Form can be cancelled in this even by setting the
Cancel argument to True. When this happens, you get the
error 2501 in the OpenForm statement.

3. If you use the Filter or the WhereCondition arguments
in the OpenForm Method, check that hese arguments are
correct.

HTH
Van T. Dinh
MVP (Access)
 
P

PeterM

I remember putting code in the form's module Form_Open
event by mistake. However, I can't remember how to get
to the code. All I can get to is the forms code. How do
I get to the form's module code?
 
V

Van T. Dinh

Open the Form in DesignView. Open its Properties window and go to the
Events tab. Click on the OnOpen row and a button with e dots will appear on
the right of the row. Click this button and the code module will open at
the right place for you.

Suggest you grab an Access VBA book and read on how to access and navigate
the VBE window.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top