Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check Box Unusual Behaviour

Status
Not open for further replies.

darrenhubbard

Technical User
Apr 28, 2003
17
GB
Hi All,

I've added a few check boxes to a form to allow the user to turn off various bits of the database.

However, the checkboxes are all enabled and unlocked and they don't even seem to be responding to their click events (I put in a simple msgbox to test this and it didn't appear!)

Anyone have any thoughts?

TIA,

Darren
 
Are you checking to see if the value of the box is 0 or -1?
 
If the check boxes are bound to fields in a non-updatable recordset, I believe they would exhibit this behavior. If you click such a text box, the status bar would display a message about the recordset not being updatable, but if you have the status bar turned off, you wouldn't have any other way of knowing.

Other than that, the only thing I can think of is that you might have a transparent control over the top of the check boxes.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Heh found a solution/workaround -- the checkboxes would respond as required to MouseDown events. So that's all-right then!

Cheers for everyone's help...
 
A day late, but I just figured out why your check boxes won't respond to mouse clicks: because they're in an option group.

When in an option group, check boxes and radio buttons lose some of their events. (Under the covers, Access actually substitutes a different kind of control which is a cut-down version of a normal check box or radio button.)

What you should depends on whether you really want an option group here. An option group links the check boxes so that only one can be selected at a time. If the check boxes are truly independent, and you only put them into an option group for the visual effect, you should replace the option group with a rectangle and a label. The check boxes will then have the full complement of properties.

If the check boxes should be linked, then leave the option group present, but instead of detecting mouse clicks, respond to the AfterUpdate or Click events of the option group itself. The individual check boxes (within an option group) have an OptionValue property which you should set to a different value for each one. When you click a check box, its OptionValue becomes the value of the parent option group, which then gets BeforeUpdate, AfterUpdate, and Click events. (Note that the Click event will not occur if you tab to the check box and press the space bar to select it.)

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top