13

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.

StuckAtWork
  • 1,613
  • 7
  • 23
  • 37

6 Answers6

30

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...

Abu Hassan
  • 301
  • 3
  • 2
4

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.

Fionnuala
  • 90,370
  • 7
  • 114
  • 152
  • So it's likely a problem with some corrupt stuff in the DB? I do know that adding a tab to this form in Layout view crashed Access a couple times, but in Design view it worked okay.. maybe there's some gremlins in the form (havn't had any other problems). I'll backup the form and try a new one. – StuckAtWork May 17 '12 at 14:35
  • Yes, it is. I find that corruption in design is much less likely with a split database. – Fionnuala May 17 '12 at 14:36
  • Splitting wasn't really necessary; database is for 1-2 people 1-2 times a year. But this did fix the problem; I redid the form (not completely yet, but basically). It seems to work. Thanks! I'd like to note though that I didn't need to redo the whole database in any way, just delete/redo the form. Didn't change anything about how I did it but.. MS strikes again I guess? – StuckAtWork May 17 '12 at 14:43
  • 1
    I've had this problem multiple times from trying to make a copy of a form as a new form - fails here every time. Just like @Fionnuala says, made a new form, copy pasted the controls and the proper magic happened. – rlb.usa Jun 17 '15 at 23:40
0

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.

0

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.

SendETHToThisAddress
  • 2,756
  • 7
  • 29
  • 54
0

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.
Taher A. Ghaleb
  • 5,120
  • 5
  • 31
  • 44
0

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

Youssri Abo Elseod
  • 671
  • 1
  • 9
  • 23