Run Time Error 2501

  • Thread starter Thread starter Tim Lund
  • Start date Start date
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
 
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.
 
Back
Top