R
Ron Lounsbury
I have a form that has a series of check boxes, each named chkErr1, chkErr2,
chkErr3, etc. I want a command button to loop through each of the check
boxes and perform an action if the checkbox is checked. I tried the
following code:
Dim thisCtl As Control
For Each thisCtl In Me.Controls
if thisCtl.type = "Checkbox" then
if thisCtl.value = 1 then
ProcessChecked
end if
end if
Next
however, the .type is not a recognized property or method for the Control
type. Can anyone tell me the right way to get only the checkboxes on the
form? I can check the name to see if it starts with "chk", but that seems
to be kludgy.
TIA
Ron Lounsbury
chkErr3, etc. I want a command button to loop through each of the check
boxes and perform an action if the checkbox is checked. I tried the
following code:
Dim thisCtl As Control
For Each thisCtl In Me.Controls
if thisCtl.type = "Checkbox" then
if thisCtl.value = 1 then
ProcessChecked
end if
end if
Next
however, the .type is not a recognized property or method for the Control
type. Can anyone tell me the right way to get only the checkboxes on the
form? I can check the name to see if it starts with "chk", but that seems
to be kludgy.
TIA
Ron Lounsbury