<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1141" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Andy:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I've got seven text boxes where I use this
technique. Three work (focus stays on the text box) and four don't (focus
moves to the next control in tab order).. Any idea why this might be? I
can't see any difference in the properties.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Rocky</FONT></DIV>
<DIV> </DIV>
<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 ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=andy@minstersystems.co.uk
href="mailto:andy@minstersystems.co.uk">Andy Lacey</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=accessd@databaseadvisors.com
href="mailto:accessd@databaseadvisors.com">accessd@databaseadvisors.com</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Sunday, March 09, 2003 11:14
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [AccessD] Set Focus On
Control When Validation Fails</DIV>
<DIV><BR></DIV>
<DIV><SPAN class=590181319-09032003><FONT face=Arial color=#0000ff
size=2>Rocky</FONT></SPAN></DIV>
<DIV><SPAN class=590181319-09032003><FONT face=Arial color=#0000ff size=2>Have
you tried in BeforeUpdate? then you don't need to set focus, just set Cancel
to True and it'll stay there.</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV> </DIV><!-- Converted from text/plain format -->
<P><FONT size=2>Andy Lacey<BR><A
href="http://www.minstersystems.co.uk">http://www.minstersystems.co.uk</A><BR><BR></FONT></P>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; 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> <A
href="mailto:accessd-admin@databaseadvisors.com">accessd-admin@databaseadvisors.com</A>
[mailto:accessd-admin@databaseadvisors.com] <B>On Behalf Of </B>Rocky Smolin
- Beach Access Software<BR><B>Sent:</B> 09 March 2003 18:45<BR><B>To:</B>
AccessD@databaseadvisors.com<BR><B>Subject:</B> [AccessD] Set Focus On
Control When Validation Fails<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Dear List</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have a couple of simple validation
tests:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> If Not
IsNumeric(Nz(txtStartingRoomNumber))
Then<BR> MsgBox "Starting Room
Number Must Be Numeric.",
vbExclamation<BR>
txtStartingRoomNumber.SetFocus<BR>
Exit Sub<BR> End If<BR>
<BR> If Val(Nz(txtStartingRoomNumber)) > 9999999
Then<BR> MsgBox "Starting Room
Number Must Be Less Than 7 Digits.",
vbExclamation<BR>
txtStartingRoomNumber.SetFocus<BR>
Exit Sub<BR> End If<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>in the AfterUpdate event of
txtStartingRoomNumber. But the SetFocus does not work. The focus
ends up being set on the next control in the tab sequence. I tried the
tests in the Lost Focus event with the same result.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I know there must be a simple way to return the
focus to the control but I can't see it. (Maybe I shouldn'</FONT><FONT
face=Arial size=2>t work on Sunday but the kids are in Sunday school and
it's quiet.) :)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>MTIA,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Rocky Smolin<BR>Beach Access
Software</FONT></DIV>
<DIV><FONT face=Arial
size=2> </DIV></BLOCKQUOTE></BLOCKQUOTE></FONT></BODY></HTML>