Just another WordPress site

12 Mar 09 Error communicating with the OLE server or ActiveX Control

Several MS Access databases working on one computer and they don’t work on another.The error message belongs to the forms of the database.When you click on a button, MS Access gives this error message:

Error communicating with the OLE server or ActiveX Control

The error is generally caused by the use of special characters in object names.When you create a form in Hungarian or other localized Access you will see, that the objects on the form get problematic names (Labels – Címke, Header – Űrlapfej, Footer – Űrlapláb, Combobox – KombináltLista etc.)The solution:1. You have to rename the special named objects on the problematic form.2. If the error remained then create a new mdb file and import all objects from your old mdb.

28 Jan 09 VBA Error Handling with line numbers

Sometimes it is easier to find an error if we know the code line where the error occurred. I have a method to show this in an error message.This is a light version of my error handler and focuses only to the line number of the error.There is a variable called “erl” which contains the line number of the error, so we can use it in the error message:

MsgBox Err.Number & " - " & Erl & " - " Err.Description

But this will show 0 instead of the line number if we didn’t put numbers at the beginning of the rows.Dick Kusleika wrote about the MZ Tools, and MZTools is a great tool for this too.There is an “add line number” icon on the toolbar which made the line numbering in my stead.

addlinenr VBA Error Handling with line numbers

Add Line Number Icon

Voila, it is done, and we can use it.