Solved

List of controls on form and data sources with VBA

Posted on 2014-11-13
2
275 Views
Last Modified: 2014-11-13
I have a database that has hundreds(!) of columns in one of the tables.  However, I don't think all of them are used.  Is there a way I can get a list of all the controls on a form and their column data source so I can weed out the unused columns in the table?

Sandra
0
Comment
Question by:ssmith94015
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 40440446
Dim ctl As Control
DoCmd.OpenForm "formx", , , , , acHidden
For Each ctl In Forms("formx").Controls
    If ctl.ControlType <> acLabel Then
        Debug.Print ctl.Name & "> Data Source : " & ctl.ControlSource
    End If

Next
0
 

Author Closing Comment

by:ssmith94015
ID: 40440543
Thanks, now at least I can get this database cleaned up.

Sandra
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
A short article about problems I had with the new location API and permissions in Marshmallow
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now