While looping through all the controls in form to collect the values entered, if it is certain ones, then need to skip

While looping through all the controls in form to collect the values entered, if it is certain ones, then need to skip.

Say if ctl.name = "AgeMin" or ctl.max = "AgeMax" then I want to say Go to next control instead and continue to execute the code in the loop.

JsaraAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Commented:
dim ctl as control
for each ctl in me.controls
   if ctl.name = "AgeMin" or ctl.name = "AgeMax" then
      'do nothing
      else

           'place your codes here

   end if
next
0
 
JezWaltersCommented:
This should get you started:
Dim ctlControl As Control

For Each ctlControl In Controls
    Select Case ctlControl.Name
        Case "AgeMin", "AgeMax"
            ' Do nothing!
        Case Else
            ' Do something!
    End Select
Next

Open in new window

0
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.