[AccessD] checkboxes

Charlotte Foust cfoust at infostatsystems.com
Mon Mar 24 17:18:28 CST 2003


Don't ask me, I just answer questions.  <vbg>  I once had a request for
option groups that met specific business rules and allowed multiple
answers under specific circumstances.
 
Charlotte Foust

	-----Original Message-----
	From: William Hindman [mailto:wdhindman at bellsouth.net] 
	Sent: Monday, March 24, 2003 2:37 PM
	To: accessd at databaseadvisors.com
	Subject: Re: [AccessD] checkboxes
	
	
	...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
<mailto:cfoust at infostatsystems.com>  
		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/1cd806b1/attachment-0001.html>


More information about the AccessD mailing list