Running 2002 version mde in Access 2007

J

Jeff K

So I was really excited about some of the new developer features in Access
2007. That was when I assumed I'd be able to use Access 2007 to run my
databases that had to remain in 2002 format, just like I could use 2003 to
run them without problems. Unfortunately, none of them will work in Access
2007.

After a few days of trial and error I finally am able to isolate at least
one situation that consistently produces errors and won't execute in the 2007
application. I have the following code fragment in a class module:

Private Withevents mfrm as Access.Form

Private Sub Class_Initialize()

If TypeOf CodeContextObject Is Access.Form Then
Set mfrm = CodeContextObject
End if

End Sub

The "set" line produces the following error:
Object or class does not support this set of events.

The error occurs under the following specific conditions. The class is in a
2002 database file compiled as an mde. The mde is then referenced as a
library from a 2002 mdb and the code in the library is called from the mdb
via a public function in the library that creates an instance of the class.

The same code executes fine when the mdb is opened in Access 2002 or 2003.
It also executes fine in Access 2007 if I set a reference to the mdb version
of the library instead of the mde version. Additionally, the mdb referencing
an mde library executes fine in Access 2007 if I convert both the mdb and the
mde library to accdb and accde formats. Unfortunately, converting is not
currently an option for hundreds of existing files due to varying versions
throughout the company.
 

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