StuckAtWork
StuckAtWork

Reputation: 1633

Communicating with the OLE Server or ActiveX Control

MS Access 2010, Win 7 on a regular form
I didn't intentionally place any ActiveX or OLE things.. not even sure what they are. But anyways, whenever I put something in the code of a particular form, it says
"The Expression XXXXX you entered as the event property setting produced the following error: A problem occured while MyDB was communicating with the OLE server or Active X Control

Huh? No matter what I put in the form's code, this happens. I had an empty Form_Current() ONLY which still tripped this. There's a lot of formatting and work into the form, I'd rather not scrap it.. If I leave the code window completely empty (only Option Compare Database), it does not trip the error; however then my form is useless.

I've seen things about this being a language issue, but my other forms (running the same code techniques and most of the same code) are fine and it's an english Access with an english language PC. Ideas?

Code setting off the error:

Private Sub Form_Current()
End Sub

Seriously.

Upvotes: 14

Views: 33199

Answers (6)

Youssri Abo Elseod
Youssri Abo Elseod

Reputation: 781

as my experience some of errors because you use your local language in VBA statement so you must adjust your local language as language of system from control banal >> language or region>>administrative>>change system local then select your local languages

or find the word was not English in vba and retype it by English

Upvotes: 0

Rob van Lint
Rob van Lint

Reputation: 1

Very strange error, that sometimes occurs in my databases too. It seems to go wrong mostly on UNBOUND FORMS (unbound forms have no RECORDSOURCE). What I have done recently is :

  1. temporarily define "some" table (e.g. a config table with just one record) as the RecordSource,
  2. compile the program (Note that this usually goes OK, even before the fix!)
  3. Save the form.
  4. Open the form. This should work fine now!
  5. Delete the RecordSource, recompile and save again.
  6. Most of the time, my forms work fine again after that.

Upvotes: 0

SendETHToThisAddress
SendETHToThisAddress

Reputation: 3714

I have run into this problem many times. The error statement is horrible as it provides basically no useful information. I have found that Abu Hassan's solution typically works best (duplicate the form and delete the original) but that did not work for me on one occasion, where I had to delete an import statement that I had recently added:

imports system.collections

Once I deleted that import statement everything worked again. So if duplicating the form doesn't work then try undoing something you recently did. It could be this import statement or one similar to it.

Upvotes: 0

Abu Hassan
Abu Hassan

Reputation: 301

I faced the same problem and I tried many things, the only (and fastest) solution that worked is to do the following: 1) Close the form that is causing the error. 2) Rename this form. 3) Duplicate it: Copy, then Paste, you will be prompted to set a name for the new form. Give it the original name. 4) Delete the original form that was causing the error. 5) Open the pasted form and it will work OK. This solution worked fine with my database... Regards...

Upvotes: 30

zhiliang
zhiliang

Reputation: 1

you can change the language setting to have a try, the steps are as follow: 1、Open window command ,run "intl.cpl" 2、choose the Administrative item ,change the system locale settings.

Hope that can help you.

Upvotes: 0

Fionnuala
Fionnuala

Reputation: 91376

Check for missing references. Make a back-up, decompile, compact & repair and if that does not work, copy everything to a new db ( http://www.granite.ab.ca/access/corruptmdbs.htm ) You may have to skip copying the problem form. Sometimes it is worth creating a new form, selecting all the controls from the old form and pasting into the new form.

Upvotes: 4

Related Questions