That error message is about as useless as they get in terms of letting you
know what to do next. Thre are a few things you can try.
Check your references. I don't think this is the problem, but it's worth a
look. More information here:
http://allenbrowne.com/ser-38.html
There could be some sort of corruption going on. More here (including the
links in the article):
http://allenbrowne.com/recover.html
You could start with something like this: Create a new form. Copy a number
of controls (maybe 20 or so) from the old form to the new one. Open the new
form. If it works, add some more controls, and test again. I expect you get
the idea. Likewise, add any code from the old form to the new one, testing
as you go.
A variation is to make a copy of the old form, then remove about half of the
controls from the old form and try to open it. If it works, try again, but
this time remove just half of the controls you removed the first time. By
this process of elimination it may be possible to identify the offending
control or code. If you can do so, replace it with a new one. It may be a
control that seems to have nothing to do with the one giving you problems,
but sometimes they fight with each other.
Going a little farther, but short of the full recovery sequence, is to create
a new blank database and import all of the objects from the old database into
the new one. Read what Allen Browne has to say about preventing corruption
(links above), including disabling Name AutoCorrect.
It may be worthwhile going through the entire recovery sequence, which is
likely to fix the problem. For decompiling I would move the database to the
root of the C: drive, as it is much simpler to type the path.
No matter what approach you take, start by making a copy of the database.
Two would be better, or just make a number of copies so you can simply delete
the copy you are working with if the repair doesn't work. In any case, work
I am getting an error message saying 'A problem occured while MS Access
was communicating withe OLE server or ActiveX control' when I insert the
said code on the click even of a cmd button. I have changed the names
accordinly so what am I missing.
Thanks
Assuming the subform control is named fsubMySub, you can toggle the Visible
property of the subform control, and change the caption of a label lblMyLabel.
[quoted text clipped - 22 lines]
[quoted text clipped - 29 lines]
Thanks