the expression On-click you entered as event property setting is causing the error while CDI was communicating with the OLE server or Active X control.

O my app I started, suddenly , to get the error:

"the expression On-click you entered as event property setting is causing the following error: a problem occurred while CDI was communicating with the OLE server or Active X control..."
It suddenly started and is starting to happen i  all events in the form (clicks, close, etc... and traps do no function.

Can anyone help me tracking the bug and recover?
João serras-pereiraAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
This sometimes means corruption. To try and resolve that:


1. Compact the database
2. Compile your code - from the VBA Editor window click Debug - Compile. Fix any errors, and continue doing this until the menuitem is disabled
3. Compact again

If that doesn't work you may need to decompile the database. To do that, create a Shortcut with this as the shortcut:

"full path to msaccess.exe" "full path to your database" /decompile

Run that shortcut, then run the 3 steps above again.

You may also need to create a new database and import everything into the new database. If you do this, run the 3 steps above on the new db after import.

You may also have a corrupt object. If so, often the import into a new database will complain when trying to move that object. If that happens, then you'd have to bypass that object, and recreate it from a recent backup (or from scratch).

If none of these work you may have to hire a recovery service like

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
João serras-pereiraAuthor Commented:
It was corruption and it is becoming a real pain
I can´t tell why it decided to go corrupt but, in reality destroyed (hopefullY) only one form.
As I was suspecting on corruption, I took a very old design of the form and imported it. I am keeping several backups of the database and, from now on I am always making a backup of the form before starting to modify it. But I really need to drop ms/access altogether

Bugs like these are costing me a heavy load in lost development hours

Thanks for the help (and for the link)
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Corruption can occur for many things, but some of the more important ones to consider during development in Access:

1. Always work on a local copy of the database. For example, don't place your Frontend on a server, and then launch Access on your local machine and open that server-based copy. Instead, pull a copy down from the server to your local machine and work on that one.

2. NEVER made code changes in break mode. Instead, stop the process, open the object in Design view, and make the changes.

3. Save your work often, and make backups regularly. Making a backup is a simple as finding the file in Windows Explorer and pressing Ctrl+C and then Ctrl+V.

4. Compact your code regularly during development. Before compacting, make a backup.

5. Turn OFF Name Autocorrect

6. Be sure to follow proper coding standards. For example, one of the more common issues if when you fail to Close objects that you open.

7. Make sure your development machine is fully up to date in regard to Windows and Office.

8. Always work with a split database - a Backend (the tables only) and a FrontEnd (everything else). Monolithic databases tend to corrupt more frequently than others.

There are other causes for corruption, but those have more to do with environment rather than development.
João serras-pereiraAuthor Commented:
Thanks again!
Of all your advices. I do not regularly follow 5 (I do not know what it is but will browse a bit to learn) and 8 (I tend to use the split at a later stage in development but after advice... will change habits ASAP)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.