<P>Hi Borge<BR>If the option group is a bound control then the following
will work in the BeforeUpdate of the option group itself.<BR><BR>If
Me.ActiveControl <> 1 Then<BR> If MsgBox("Sure?", vbYesNo +
vbQuestion, "SURE?") = vbNo Then<BR> Cancel =
True<BR> Me.ActiveControl.Undo<BR> End If<BR>End
If<BR><BR>If it's unbound you have to do a bit more yourself because Undo
doesn't work. So here's an example, keeping a var to hold the previous value
and another to monitor if the user has cancelled.<BR><BR>Dim intOldValue As
Integer<BR>Dim blnCancelled As Boolean</P>
<P>Private Sub Frame0_AfterUpdate()<BR>If blnCancelled = True Then<BR>
Me.ActiveControl = intOldValue<BR>Else<BR> intOldValue =
Me.ActiveControl<BR>End If<BR>End Sub</P>
<P>Private Sub Frame0_BeforeUpdate(Cancel As Integer)<BR>blnCancelled =
False<BR>If Me.ActiveControl <> 1 Then<BR> If MsgBox("Sure?",
vbYesNo + vbQuestion, "SURE?") = vbNo Then<BR>
blnCancelled = True<BR> End If<BR>End If<BR>End Sub</P>
<P>Private Sub Frame0_Enter()<BR>intOldValue = Me.ActiveControl<BR>End
Sub<BR><BR><BR>HTH<BR><BR>--<BR>Andy
Lacey<BR>http://www.minstersystems.co.uk<BR><BR><BR><BR></P>
<BLOCKQUOTE dir=ltr style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px;
MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">--------- Original Message --------<BR>From:
"Access Developers discussion and problem solving"
<accessd@databaseadvisors.com><BR>To: "Access Developers discussion
and problem solving" <accessd@databaseadvisors.com><BR>Subject:
[AccessD] How to Cancel Selected Item in Optiongroup?<BR>Date: 15/09/03
07:39<BR><BR><FONT face="Courier New" size=2><BR>I am stuck on this
one:<BR><BR>I have an option group with three radion buttons (value 1, 2 and
3), with<BR>the On_Open event of the Form setting the default value to
1.<BR>Now, if a radio button that represents either value 2 or 3 is clicked
the<BR>client wants a message box to appear with a 'do you really want to
etc....'<BR>with Yes/No command buttons. If response is No, the event should
be<BR>cancelled.<BR><BR>I've been playing around with the beforeupdate and
afterupdate event of the<BR>option group.... can't get it to
work.<BR><BR>Any
suggestions?<BR><BR>Thanks<BR>Borge<BR><BR><BR><BR><BR>_______________________________________________<BR>AccessD
mailing list<BR><A class=autolink
href="mailto:AccessD@databaseadvisors.com">AccessD@databaseadvisors.com</A><BR><A
class=autolink href="http://databaseadvisors.com/mailman/listinfo/accessd"
target=_blank>http://databaseadvisors.com/mailman/listinfo/accessd</A><BR>Website:
<A class=autolink href="http://www.databaseadvisors.com/"
target=_blank>http://www.databaseadvisors.com</A><BR><BR><BR><BR><BR><BR><BR></FONT></DIV></BLOCKQUOTE><BR
/>
<BR />
________________________________________________<BR />
Message sent using UebiMiau 2.7.2<BR />