<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1141" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=866001322-24032003><FONT face="Comic Sans MS" color=#0000ff
size=2>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.</FONT></SPAN></DIV>
<DIV><SPAN class=866001322-24032003><FONT face="Comic Sans MS" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=866001322-24032003><FONT face="Comic Sans MS" color=#0000ff
size=2>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. </FONT></SPAN></DIV>
<DIV><SPAN class=866001322-24032003><FONT face="Comic Sans MS" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=866001322-24032003></SPAN><SPAN class=866001322-24032003><FONT
face="Comic Sans MS" color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=866001322-24032003><FONT face="Comic Sans MS" color=#0000ff
size=2>Charlotte Foust</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Pedro Janssen
[mailto:pedro@plex.nl] <BR><B>Sent:</B> Monday, March 24, 2003 2:07
PM<BR><B>To:</B> AccessD@databaseadvisors.com<BR><B>Subject:</B> [AccessD]
checkboxes<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Hello Group,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>When i have a form with 10 checkboxes (chb1 to
10) and only one may be True.</FONT></DIV>
<DIV><FONT face=Arial size=2>Is there a way to get an error message when
you select two checkboxes as True.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>TIA</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Pedro
Janssen</FONT></DIV></BLOCKQUOTE></BODY></HTML>