Persistent MS Access Class Objects Forms

G

Guest

I am trying to create a new module in my access DB. I'm having trouble
getting anything done (saving, pasting code, etc.). I think my problem is
due to some old forms that are persistent in my database. I can't seem to
get rid of them for some reason. They are contained inside the Microsoft
Access Class Object folder inside the VB application. I am often getting the
message: "the form 'form_xxxx' is missplelled or refers to a form that
doesn't exist.

When I try to remove the forms by right-clicking, the option to remove the
forms is not available. This is seriously limiting my ability to get any VBA
coding done inside the database. Should I just do a mass data export to a
fresh database? Thanks for any assistance. Ruben.
 
K

Ken Snell \(MVP\)

Small amount of corruption -- the form was deleted but the form's module
remains.

I often get rid of these leftover modules (they're rare, by the way) by
creating a new form with exactly the same name as the form whose module got
left behind. Then create an event procedure for a control in the form. Then
close the form and delete it. This usually "attaches" the module to the form
and the module deletes with the form.

Alternatively, create a new database and import all the objects from the old
database into the new one. This too should leave behind the orphaned
modules. You then can delete the old database.
--

Ken Snell
<MS ACCESS MVP>




"Jose Ruben Gonzalez-Baird"
 
G

Guest

Ken,

Thanks for your suggestion. I tried the method that you proposed by
creating new forms with the same name and then creating a control with an
event procedure.

This seemed to work on the first try. I created the form "Switchboard",
then a simple button that had an event procedure of step forward in the
record list. After deleting the form, the "orphaned" module was removed, but
a new module named Form1 appeared and I was not able to remove it either by
deleting it from the module list or by using the convention that you
prescribed. Further, after trying to create new forms to match the other
orphaned modules, not only were those modules not removed after deleting the
form, but a new set of modules were created that were also persistent (Form2,
Form3, etc.). In the end I simply created a new DB and imported only my
tables and queries into that. I can now create new modules in the new DB w/o
any hangups. Thanks again for your suggestions. This was something that had
been plaguing that database for a while and now (hopefully, finally) we are
rid of it. Best Regards, Ruben.
 

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