Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2004
    Posts
    32

    Unanswered: Looping through form controls

    I want to create a common function that will loop through the controls on a form. It needs to be able to work on all forms regardless of how many controls there are. I will then get the values and put them in an array.

    cheers

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Someone on this forum gave me this code in VBA which does what you want. Customize as needed!
    Code:
    Dim ctl As Control
    
            For Each ctl In Me.Controls
                    Debug.Print ctl.Name
            Next ctl
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •