[AccessD] checkboxes

William Hindman wdhindman at bellsouth.net
Mon Mar 24 16:37:01 CST 2003


Message...hhhmmm ...ok ...but why? 
...Checkboxes can be used in an Option Group and all the functionality is built in without a line of code :)

William Hindman
"All it takes for evil to prevail is for good men to do nothing." Edmund Burke

  ----- Original Message ----- 
  From: Charlotte Foust 
  To: accessd at databaseadvisors.com 
  Sent: Monday, March 24, 2003 5:21 PM
  Subject: RE: [AccessD] checkboxes


  As William suggests, that is what option groups were created for.  However, if you want to do it with checkboxes for whatever reason, here's how.

  Put all the checkboxes sequentially, 1 - 10, into a collection and use the name of the checkbox as the key so you can refer to the members either by name or by index number.  Alternatively, use an array declared as CheckBox and use the numeric portion of the name as the index.   Create a form level flag that is a boolean and set it to True in the afterupdate event of each checkbox but only if the checkbox is set to true.  Then you can easily use the BeforeUpdate event of each checkbox to see if the flag is already set.  If it is, you can quickly loop through the collection or the array to see which one is set to True.  The handling after that will be up to you.   You could either pop up an error message or simply change the other checkbox to false and the current one to true.    


  Charlotte Foust
    -----Original Message-----
    From: Pedro Janssen [mailto:pedro at plex.nl] 
    Sent: Monday, March 24, 2003 2:07 PM
    To: AccessD at databaseadvisors.com
    Subject: [AccessD] checkboxes


    Hello Group,

    When i have a form with 10 checkboxes (chb1 to 10) and only one may be True.
    Is there a way to get an error message when you select two checkboxes as True.

    TIA

    Pedro Janssen


------------------------------------------------------------------------------


  _______________________________________________
  AccessD mailing list
  AccessD at databaseadvisors.com
  http://databaseadvisors.com/mailman/listinfo/accessd
  Website: http://www.databaseadvisors.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030324/11fc4d3c/attachment-0001.html>


More information about the AccessD mailing list