sub form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 

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