Run Time Error 2501

T

Tim Lund

I'm getting this error when I run this line of code with
an Access97 database:

DoCmd.OpenForm "formName"

The rest of the error message goes on to say that I have
opened a form but then cancelled, which is not true. I
have other databases which do the same thing, without any
problems. Could it be significant that this database was
genereated by converting back from Access 2000?

Tim
 
V

Van T. Dinh

It is possible that the opening of the Form is cancelled and you get this
error message. One of the common situations is that the Form which is being
opened has code in the Open Event to check whether the Form's Recordset is
empty or not and if it is empty, cancel the Form's Open Event, i.e. cancel
the opening of the Form.

Check whether you have the Form_Open Event of the target Form and if
somewhere in this code, you have Cancel = True.
 

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

Similar Threads


Top