OpenForm action cancelled

G

Gary

Hello,

We have a database running Access 2000. At startup the user can select
various items. One of them is a form to check an order's status.

If I run the original MDB Access file, it does nothing. If I make and run
the MDE I get:
"2501

The OpenForm action was cancelled."

(2501 is the err.number)
I verified the form name is called correctly and I can open the form in
design view and all is fine there. However, when I try to view the form in
runtime, it just either hangs or gives the error (that's an oddity as well
that there are two different things happening in two different versions!)

I even ran it on the server that the database resides on (i.e. locally and
not through the network) same thing.

The VBA has only one line:
DoCmd.OpenForm "OrderStatusCheck"

and the error handling code.

Anyone else come across something like this or have any thoughts on what
might be wrong?

Thanks in advance,

Gary
 
D

Dirk Goldgar

Gary said:
Hello,

We have a database running Access 2000. At startup the user can select
various items. One of them is a form to check an order's status.

If I run the original MDB Access file, it does nothing. If I make and
run the MDE I get:
"2501

The OpenForm action was cancelled."

(2501 is the err.number)
I verified the form name is called correctly and I can open the form
in design view and all is fine there. However, when I try to view the
form in runtime, it just either hangs or gives the error (that's an
oddity as well that there are two different things happening in two
different versions!)

I even ran it on the server that the database resides on (i.e.
locally and not through the network) same thing.

The VBA has only one line:
DoCmd.OpenForm "OrderStatusCheck"

and the error handling code.

Anyone else come across something like this or have any thoughts on
what might be wrong?

Can you open the form directly from the database window?

If the form's recordsource is a query or SQL statement, make sure that
the query itself can be successfully opened. If you need to, paste the
SQL into a new query's SQL view to test it. IIRC, if there's a syntax
error in the form's recordsource query, Access will cancel the opening
of the form. Error handling may be different in the MDE than in the
MDB.
 
G

Gary

Dirk Goldgar said:
Can you open the form directly from the database window?

If the form's recordsource is a query or SQL statement, make sure that
the query itself can be successfully opened. If you need to, paste the
SQL into a new query's SQL view to test it. IIRC, if there's a syntax
error in the form's recordsource query, Access will cancel the opening
of the form. Error handling may be different in the MDE than in the
MDB.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
Thanks Dirk,

It actually opens a query and the query runs fine. Except one of the
records comes up with a string of #Error across the board. I can't seem to
delete it however, it keeps squawking "Invalid Argument" Any suggestions on
how to purge it? I'll try to compact it now.

Thanks for the help!

Gary
 
G

Gary

Gary said:
Thanks Dirk,

It actually opens a query and the query runs fine. Except one of the
records comes up with a string of #Error across the board. I can't seem to
delete it however, it keeps squawking "Invalid Argument" Any suggestions on
how to purge it? I'll try to compact it now.

Thanks for the help!

Gary
Dirk,
I answered my own question. The compact worked great. I got the
corrupted order deleted and the form opens fine once again. Thanks for the
guidance, it was a Huge help!

Have a great day!
-Gary
 
D

Dirk Goldgar

Gary said:
I answered my own question. The compact worked great. I got the
corrupted order deleted and the form opens fine once again. Thanks
for the guidance, it was a Huge help!

Clearly you had a corrupt record, and your compact (which includes a
repair) fixed it. Well done! Be sure to back up the database at this
point, just in case there's still some hidden corruption that bites you
later.
 
V

Van T. Dinh

I agree with Dirk 100%.

In fact, I would recommend also creating a new empty database and import all
objects from the existing database. Compile and Compact this new database
and make a copy of this as a back-up.
 

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