[AccessD] checkboxes

Charlotte Foust cfoust at infostatsystems.com
Mon Mar 24 16:21:31 CST 2003


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030324/62f09e2c/attachment-0001.html>


More information about the AccessD mailing list