I am posting this again as the problem has not been resolved!
I developed a database from scratch several months ago which uses lots of
vba code. Every now and then my users suddenly get automation errors, and
code which has been working fine suddenly gets error messages which say:
and the following code is highlighted
Dim dbs As Database
The help text is useless! It says "An error occurred while executing a
method or getting or setting a property of an object variable. The error was
reported by the application that created the object."
After tearing my hair out trying to fix it I have found that if I start a
new blank database, import everything and make the splash form open on
startup (the way it was before) I'm OK for a while then suddenly one day it
will give me the same error. This is Access 97 on a Win98SE machine. I
work with several other dBs and this is the only one this happens to.
Can someone tell me what is going on here? I have reinstalled Office 97 to
no avail. I have tried Repairing and Compacting but it doesn't help. My
users are not able to handle being thrown into vba code in the middle of
data entry, and I have to recopy the database elements again!
Update to my last messageboard post:
Last time I copied all the forms, modules, etc to another blank database I
started getting another error:
Error 32811: Unexpected error
Microsoft says this happens when importing a form from a prior version.
However I am not importing a form. This happens when entering data in a
form and a subform is referenced. The highlighted code is
Dim sb as Subform
I started a new blank form for the subform, copied the fields and the VBA
code and the error 32811 went away on my machine but not others. I
recreated the other subform and now I am back to "Automation Error", which
doesn't allow code changes or anything; it locks up the database.
There are also nowhere near 700 controls, etc on this form, only 29
including the subform fields and controls, which is one Microsoft
explanation for the error.
Somebody please give me some help here!