Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

List of controls on form and data sources with VBA

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

856 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