cycling thru controls on a form

  • Thread starter Thread starter Ted
  • Start date Start date
T

Ted

Hi all,

I have several forms with a lot of check boxes on it. Each checkbox
represents a form that will print out if its corresponding check box is
checked. instead of writing an if...then statement for each checkbox i would
rather write code that will automatically check all checkbox controls on the
form to see if its checked. i think i can do this with For...Each?

Help please

Thanks in Advance
Ted
 
Dim ctlCurr As Control

For Each ctlCurr In Me.Controls
If TypeOf ctlCurr Is CheckBox
' Do your checking here...
End If
Next ctlCurr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top