Solved

List of controls on form and data sources with VBA

Posted on 2014-11-13
2
282 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
A short article about problems I had with the new location API and permissions in Marshmallow
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

831 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