Link to home
Create AccountLog in
Microsoft Access

Microsoft Access

--

Questions

--

Followers

Top Experts

Avatar of jcolles
jcolles

Access error communicating with OLE server or active X control
I am writing a database and cannot find the cause of an error.
The  main form is called fContacts and on it there are a number of tabs containing different subforms.  One subform called fDonations works perfectly, but the last one I added fGrantApplications does not.  As soon as I type an entry into the subform, I get an error

 'A problem occurred while Microsoft Access was communicating with the OLE server or ActiveX Control.
Close the OLE server and restart it outside Microsoft Access. Then try the original operation again'.

Once I have cleared this error, i can continue to fill data into the subform, but as soon as I move off the subform I get another error

"You cannot add or change a record because a related record is required in table 'Contacts'"

The form fContacts has a a primary key contactid and the subforms have a foreign keys contactid which is linked in both cases.   I cannot see why one subform should work, but not the other.
I am showing the contactid in a textbox on each subform and whereas the fDonations one changes when I move to another record in the main form, the one on the GrantApplication subform does not.  I have had this problem for about a week now and am making no progress
HELP!!

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of ErezMorErezMor🇦🇺

can you post a (simplified) mdb with just the main and sub forms in question?

Avatar of jcollesjcolles

ASKER

I've tried cutting it down, but it brings up so many errors, so I have just removed any identifying text  and attached it complete.  The only tab which has a problem is the Grant aid one which is in essence identical to the Donations one
test.mdb

Avatar of Luke ChungLuke Chung🇺🇸

What type of ActiveX control are your running? Lots of VB6 ActiveX controls will not work properly on Access forms and reports because the containership is different.
This led to our creation of Total Access Components which is a set of 29 controls designed specificaly for Access (http://www.fmsinc.com/MicrosoftAccess/Controls.html)
Unfortunately, it was not easy....especially if you're doing data binding.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of John Mc HaleJohn Mc Hale🇮🇪

jcolles,

Open any code module, click on Tools...References, remove your reference to Microsoft ActiveX Data Objects 2.1 Library, and replace it with a more respectable version (2.6 and above).

HTH

This is a difficult error to troubleshoot, especially without any code to reference.

Try all the other suggestions first.
Then report back


Then try some of these common fixes, in order of "severity":
- Compile the code and run the Compact/Repair utility.
- Delete the offending control and reinsert a new one.
- Create a blank new database and impost all of the objects.
- Recreate the Form from scratch

JeffCoachman

Avatar of ErezMorErezMor🇦🇺

the problem solved in the attached mdb file.
the exact problem i dont know, but in those obscure occassions, like this one, all i did was:
application.SaveAsText acForm,"FormNameHere",currentproject.Path & "\TextFileNameHere"

to both fContacts and fGrantApplication forms, then DELETE them from the mdb file, and then use:

application.LoadFromText acForm,"FormNameHere",currentproject.Path & "\TextFileNameHere"

to re-build the forms from scratch, and voila! it fixed the error

as far as i remember the above (undocumented) commands are used internally for replication, but are for rebuilding forms that gone bad...

cheers.
test2.mdb

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of John Mc HaleJohn Mc Hale🇮🇪

jcolles,

I downloaded your database and resolved the problem by taking the steps outlined in my earlier post.

HTH.

Avatar of jcollesjcolles

ASKER

Thanks very much for your help.  I had already tried removing and regenerating the subform and tab, and importing everything to a new database, but none of these worked.  Just for future reference, where do you enter the commands:

 application.SaveAsText acForm,"FormNameHere",currentproject.Path & "\TextFileNameHere" etc

It sounds like a pretty useful technique for times like this

ASKER CERTIFIED SOLUTION
Avatar of ErezMorErezMor🇦🇺

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of John Mc HaleJohn Mc Hale🇮🇪

jcolles,

Have you tried replacing the referenced version of Microsoft ActiveX Data Objects 2.1 Library with something more recent?

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of jcollesjcolles

ASKER

Thanks  to everyone who answered, I really appreciate your help and would not have solved that one without it
Microsoft Access

Microsoft Access

--

Questions

--

Followers

Top Experts

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.