"Phil Reynolds" <ph*******@msn. comwrote in message
news:LC******** **********@news svr21.news.prod igy.net...
When looping through all controls on a form in code, is it possible to
determine what section a control belongs to? I want to skip controls in
the footer for some code I'm doing.
To determine which section a control belongs to:
Dim ctl As Access.Control
For Each ctl In Form.Controls
If ctl.Section <acFooter Then
'Do something with ctl
End If
Next
or you could loop over each section seperately:
For Each ctl In Form.Section(ac Header).Control s
'Do something with ctl
Next
For Each ctl In Form.Section(ac Detail).Control s
'Do something with ctl
Next