Collections ?

cheuschober

Muse of Fire
Local time
Yesterday, 20:41
Joined
Oct 25, 2004
Messages
168
Is there a 'catch all' way to select only the controls found within a specific section of the form... say I wanted to perform an operation on all the controls in the detail section of the form but not those found in the header or footer?

Any quick way (collection) to this solution?

Many thanks,
~Chad
 
G’day Chad.

Something like this should get the job done: -

Code:
Option Explicit
Option Compare Text


Private Sub Form_Open(Cancel As Integer)
    Dim ctl As Control
    
    For Each ctl In Me.Section(acDetail).Controls
        MsgBox ctl.Name
    Next ctl

End Sub

Hope that helps.

Regards,
Chris.
 

Users who are viewing this thread

Back
Top Bottom