Counting activeX controls in MS Access 2010

Does anyone know a way I can get a total count of all the activeX controls used throughout a large MS Access 2010 application? (Including the control name would be great)
Who is Participating?
IrogSintaConnect With a Mentor Commented:
Running something like this will give you the form name and the ActiveX controls within each form.  The results will show up in the Immediate Window with the total count at the end:
    Dim obj As AccessObject
    Dim ctl As Control
    Dim i As Integer
    For Each obj In Application.CurrentProject.AllForms
        DoCmd.OpenForm obj.Name, acDesign, , , , acHidden
        For Each ctl In Forms(obj.Name).Controls
            If ctl.Properties("ControlType") = acCustomControl Then
                Debug.Print obj.Name, ctl.Name
                i = i + 1
            End If
        DoCmd.Close acForm, obj.Name
    Debug.Print "Total: " & i

Open in new window

Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
You'd need to use some VBA code to run through each form and the controls collection, using TypeOf to determine the type of control.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Correct me if I'm wrong, but in almost every case the ActiveX control will add a reference to the database, so you could review the References to see what's been added. At least, that's been my experience with using ActiveX with Access - but again, I could be wrong about that.
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Luke ChungPresidentCommented:
Our commercial product, Total Access Analyzer, performs comprehensive documentation and cross-referencing of your Access database.

The Database Summary report shows a list of all the ActiveX controls that are used in the database:
In that example of Northwind, no ActiveX controls are shown.

Part of the detailed analysis is the documentation of ActiveX controls in separate reports (or views) showing the list of ActiveX controls and reference reports showing where they are used:

ActiveX Controls Summary
ActiveX Control References
Sorted by ActiveX Type
Sorted by Object Name

Hope this helps.
Jeffrey CoachmanMIS LiasonCommented:
To be clear:
Counting activeX controls in MS Access 2010
So you only want to count Active X controls ( for ex.: web browser, treeview, slider, ...etc) controls,  ...and not standard Access controls (Textbox, command button, combobox, ...etc)

Jeffrey CoachmanMIS LiasonCommented:
<No Points wanted>

If you want just the Access standard controls , just change IrogSinta code to:
    If ctl.Properties("ControlType") <> acCustomControl Then

If you want "All" the controls, comment out the IF block

Again,no points wanted as this is all piggy-backing on Ron's original code, so points to him...


KnowledgeWareAuthor Commented:
Thanks to all, awarded to IrogSinta (thanks Jeff for additional info) and yes Luke is right that Total Access Analyzer would do this - I need to upgrade to the 2010 version!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.