Communicating with the OLE Server or ActiveX Control
Asked Answered
N

6

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.

Nath answered 17/5, 2012 at 14:25 Comment(0)
S
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.

Spinescent answered 17/5, 2012 at 14:31 Comment(4)
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.Nath
Yes, it is. I find that corruption in design is much less likely with a split database.Spinescent
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?Nath
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 @Spinescent says, made a new form, copy pasted the controls and the proper magic happened.Canna
G
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...

Gavin answered 30/3, 2015 at 20:12 Comment(3)
Thanks for your attempt to provide a new approach to this problem. However, bear in mind, this question is two years old, and already has an accepted answer.Cletacleti
This worked for me. Very fast indeed - thanks for saving me a lot of hassle!Xenophobe
Worked for me with a broken Access 2013 form. +1Chokecherry
S
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.

Spinescent answered 17/5, 2012 at 14:31 Comment(4)
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.Nath
Yes, it is. I find that corruption in design is much less likely with a split database.Spinescent
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?Nath
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 @Spinescent says, made a new form, copy pasted the controls and the proper magic happened.Canna
E
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.

Electromechanical answered 20/6, 2014 at 2:54 Comment(0)
G
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.

Gibeonite answered 23/3, 2018 at 6:35 Comment(0)
O
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.
Outsail answered 17/12, 2018 at 12:45 Comment(0)
U
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

Unisexual answered 26/2, 2020 at 11:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.