Solved

Can not open form: The Microsoft Jet Database Engine could not find the object....

Posted on 2004-08-02
9
684 Views
Last Modified: 2012-06-22
While attempting to close MS-Access 2K, I received the reminder that a form and module were not saved.
The usual message, "Save Changes to the Following Objects" was displayed.
I pressed the CANCEL button.

The form that was not saved was calling a function saved in the module.

Now, when I attempt to open the form in design view, nothing happens.
The form does not open and no error messages are displayed.

When I attempt to open the module, I recieve the message "You have canceled the previous operation"

Compact and repair does not help.  Copying all the objects to an empty database seems to correct the problem with the module, however, I still can not open the form.  I receive the message, the Microsoft Jet Database Engine could not find the object....

Is there any way I can retrieve the code from the form?
0
Comment
Question by:pcalabria
9 Comments
 
LVL 34

Expert Comment

by:flavo
Comment Utility
see if this works (works if the form hasnt crashed at least)

Function getCode()

Dim frm As Form
Dim i As Long

Set frm = Form_frmMyForm  'change to From_whateverYourFromIsCalledHere


If frm.HasModule Then
       i = frm.Module.CountOfLines
       Debug.Print frm.Module.Lines(1, i)
End If

End Function

Dave
0
 
LVL 34

Expert Comment

by:flavo
Comment Utility
Will write the code behinde the form in the debug window (to open this, press Crtl+g)
0
 

Author Comment

by:pcalabria
Comment Utility
Dave,

No good.

I get the message "Module Not Found"

I tried your code on a working form, and the code does work, it just doesn't work with the damaged form.
I'd be happy to try any other ideas that you have.  


0
 
LVL 34

Expert Comment

by:flavo
Comment Utility
Try copy and paste???

Im all out of ideas after that sorry..  If compact and importing doesnt work, im at a loss.

I thought you could save a from to file, but maybe that's only Excel.

Sometimes its just best to start over (unless you have a backup)

Dave
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:pcalabria
Comment Utility
I'm not sure what you mean by try copy and paste.

The problem is that, while the form's name appear in the list of forms, when I select its name then press the design view button, absolutely nothing happens.  It is as if the form was not there.
0
 
LVL 34

Expert Comment

by:flavo
Comment Utility
select it, press ctrl+c, then ctrl+v and a window should prompt you for a name.  call it tempForm for example and see
0
 
LVL 26

Expert Comment

by:dannywareham
Comment Utility
If all else fails, back up your original and start again.

Sounds like the form is attempting to open and run your code.
So when you open the module, it interupts the running and displays your error "you cancelled previous operation"
I've not seen this problem on a conversion before, but have seen it on a currupt 97 db.
0
 
LVL 4

Accepted Solution

by:
szacks earned 500 total points
Comment Utility
try opening Acces in decompile mode (That is go to Start->run type msaccess /decompile then open up your form and see if it works.

Supposedly this removes a lot of the garbage from the file and I've seen it fix numerous other weird problems.
0
 

Author Comment

by:pcalabria
Comment Utility
Thank you szacks!!!

Openning Access in decompile mode exposed the code window for the form!!!!  This allowed me to copy the code and use it to recreate a new form!

While I did lose all the objects on the old form itself, replacing a 125 combo and text buttons was nothing compared to rewriting the code again.  Thank you Thank you.  Did I say I was very happy that I was able to save the code?  :-)  Thank you!

Flavo, thanks again for your help.  When I tried to copy and paste the form it did cause another name to show up in the form list, however, attempts to open the form gave me a Jet database error.

dannywareham, thanks for your help too.  The form did have embeded code that called a routine in the crashed module... Perhaps it was trying to verify that the module was present before the form openned.  Since the module had crashed, the form would not try to open.

Regardless of the reason why the form would not open, when I opened access in Decompile mode the form and module code windows automatically opened!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now