VBA/Jet Error handling

N

NH

I am trying to to trap and handle a Jet error;
-2147217865: The Microsoft Jet database engine could not find the object....

I have tried to put the following line in my error handling;

If err.number = -2147217865 Then ...

but it never matches..

Debug.print err.number gives me -2147217865,
but IF err.number = -2147217865 never fires..

What am I doing wrong?

Thanks
 
J

Jeanette Cunningham

NH said:
I am trying to to trap and handle a Jet error;
-2147217865: The Microsoft Jet database engine could not find the
object....

I have tried to put the following line in my error handling;

If err.number = -2147217865 Then ...

but it never matches..

Debug.print err.number gives me -2147217865,
but IF err.number = -2147217865 never fires..

What am I doing wrong?

Thanks
 
J

Jeanette Cunningham

NH,
when you step through the code, find which line causes the error.

If for example the error happened on a line which said
DoCmd.OpenForm "frmMyNewHate"
You would check that the form called frmMyNewHate was correctly spelled.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

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