Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Access Runtime VBA Not Working
Krzysztof Kaminski 

12 months ago
Hello
I have issue which, as I believe is problem with running VBA code by access runtime.
For tests and to confirm I have created very simple database - just a form with one button. This button has only on_click event defined as
msgbox "test".
The problem is that no matter what I do I get error when this event is run.
The error i get sounds something like ( I need to translate it for You):
"There was an error during communication between program (database.accdb) and OLE server or ActiveX control".
It does not matter if I compile the database or not. I have tried runtime version 2013, 2016 and 365.
If I change on_click event to macro - it works.
I have added trusted location in registry.
Anyone have experienced such issue? Is VBA somehow disabled on this PC? PC OS is Windows 11 Pro.
Sami Shamma  @Reply  
             
12 months ago
Are you using ActiveX controls in that database?
Alex Hedley  @Reply  
           
12 months ago
While in a module, when you go to Tools/References, do you have the OLE Automation checked?
Krzysztof Kaminski OP  @Reply  

12 months ago

Krzysztof Kaminski OP  @Reply  

12 months ago
I am not eperienced enough to be sure but as far as I can tell I haven't added anything custom to the form (which I would consider as potential ActiveX control), just ordinary button.

Yes, there is OLE Automation checked.
Krzysztof Kaminski OP  @Reply  

12 months ago
I have made another interesting test.
Button #1 stays the same - simple macro to display "test" in msgbox on on_click event. It works.
I have added Button #2 - simple macro this time conditional (also on_click event)
if CurrentProject.IsTrusted=false then msgbox "false"
if CurrentProject.IsTrusted=true then msgbox "true"
Button 2 does not work, it causes the same error.
Everything works fine on PC with full version of access.
Krzysztof Kaminski OP  @Reply  

12 months ago
So, I have made a little progress.
I have taken 2nd PC - exactly the same hardware, exactly the same software. I have installed access runtime 365 x64 on it.
I have copied the simplified database to 2nd PC, added path to trusted locations in registry and run the databse file - it does not work. Exactly the same error.
Then I have cleaned whole PC, installed new clean windows 11 os and access runtime 365. It did not change a thing - the same error.
After that I have uninstalled runtime 365 and installed full Access 365 on it - the simplified database still gave the same error...
Trust center:
I have enabled ALL activeX - it did not help
I have enabled ALL macros - it did not help

I was out of ideas but...
Krzysztof Kaminski OP  @Reply  

12 months ago
On this 2nd PC I have made this simplified databse from scratch - new clean accdb file just with one Form and a button on it with on_click event (VBA):
msgbox "test".
To my surprise IT DID WORK.
So I have made a new clean accdb file and copied every single object from original database - tables, queries, forms, reports and modules.
"Save it, close it, open it" - IT WORKS!
I have uninstalled full access and installed runtime - new recreated accdb still WORKS!
Then I have copied this "new" database to my PC where I have always full version of Access 365 and... It gave me the same error "There was an error during communication between program and OLE server or ActiveX control".
Am I crazy? I mean, there is always a chance but...
Anyone might have a clue where the problem is?
Donald Blackwell  @Reply  
       
12 months ago
May or may not help, but here's what Co-Pilot had to say:

1) The Access Runtime doesn't fully utilize and expose the Trust Center so sometimes the CurrentProject.IsTrusted will cause that error

2) The form (even if it's very basic) may have been corrupted some how. Try rebuilding from scratch or copying the controls and code to a new form and see if the problem gets resolved.

3) If your form was created on a machine using a different language or character set (other than basic english) and your control names have non-"standard" letters/characters the runtime doesn't always have the ability to handle those characters and will cause errors.

Krzysztof Kaminski OP  @Reply  

12 months ago
Thank You Donald for reminding me about regional settings - I've experienced problems with it in the past. Anyway I have checked it and on all 3 involved machines they are set equal. I am careful not to use any "special characters" in code and naming.
For now I think I can say it is not purelly Access Runtime issue since i have now accdb which does not work with full Access 365 "dev" PC and gives this error.
I have copied recreated (on 2nd PC) accdb to 1st PC and it works so I think corruption is also not the case.
I am trying to solve this for more than a week now. I have co-pilot on the left, chatGPT on the right and 599cd.com in the middle :)

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/21/2026 12:44:41 PM. PLT: 0s