automatically checking checkboxes

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!
 
W

Wayne Morgan

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.
 
G

Guest

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.
 
P

Pavel Romashkin

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
 

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

Top