<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2800.1141" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<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>
accessd-admin@databaseadvisors.com [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></FONT></BODY></HTML>