Richard said:
Hello,
I have a sub form that has check boxes for user input, I want to put
a command button on my form so the user can clear the checked boxes all at
once.
any thoughts?
Hi Richard,
if you want to clear all check boxes then maybe...
dim ctl as control
for each ctl in controls
if ctl.controltype=accheckbox then
ctl=false
end if
doevents
next ctl
Alternatively to clear specific checkboxes then possibly give them the same
name with a numeric suffix...
dim intLoop as integer
for intLoop=1 to numberOfCheckboxes
controls("checkboxes" & intLoop)=false
doevents
next intLoop
Alternatively to clear checkboxes with non-specific names, assign names to
an array...
dim varCheckboxes as variant
dim intLoop as integer
varCheckboxes=array("name","name",...)
for intLoop=0 to ubound(varCheckboxes)
controls(varCheckboxes(intLoop))=false
doevents
next intLoop
Luck
Jonathan