automatically checking checkboxes

  • Thread starter Thread starter Jennifer
  • Start date Start date
J

Jennifer

On a form I use, it often happens that all checkboxes are
supposed to be checked for a record. For ease of entry
I'd like to have a checkbox at the top with an "All
complete" label that would then automatically set the
rest of the checkbox values to true. I'd like this to
happen as soon as the "all complete" box is checked, not
after moving to another record, which is the only way
I've made it work. My data entry people won't be able to
figure that oddity out.

Default values are set to false. All checkboxes are bound
except the "all complete" one. I'm thinking an IIF
statement is the way to go but am not sure which checkbox
(es) property sheets' it should go to, which event should
trigger it, etc. Any suggestions??? Thanks!
 
In the AfterUpdate event of the All checkbox, cycle though the other
checkboxes and set them to True. What do you want to do if the user then
unchecks the All checkbox (i.e., they clicked it by mistake)?

Me.chkCheckbox1=True
Me.chkCheckbox2=True
etc.
 
Basically, if "All" is checked, I want the other boxes
checked. If "All" is unchecked/cleared, I want them to
clear as well. If "All" does not apply to the record, I
want to be able to check individual boxes without
affecting any others.
 
In that case, make Wayne's code look like

Me.chkCheckbox1=Me.AllChecked
Me.chkCheckbox2= Me.AllChecked

and so on, or write a loop to shorten the code.

Pavel
 
Back
Top