<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 10 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle17
{font-family:Tahoma;
color:windowtext;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'>This seems like a simple task.</span></font></p>
<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'>I have a continuous form with the following fields: [AcctNum],[Charges],[Payments],[Balance].</span></font></p>
<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'>I do not want the user to be able to move off of the record
if [Balance] <> [Charges]-[Payments].</span></font></p>
<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'>I put the following code in the AfterUpdate event of the
[Balance] field:</span></font></p>
<p class=MsoNormal><font size=2 color="#333399" face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;color:#333399'>If Me.Balance
<> (Nz(Me.Charges) - Nz(Me.Payments)) Then</span></font></p>
<p class=MsoNormal><font size=2 color="#333399" face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;color:#333399'> MsgBox
"Current Balance does not equal Total Charges minus Payments.", vbCritical,
"Error"</span></font></p>
<p class=MsoNormal><font size=2 color="#333399" face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;color:#333399'> Me.Balance.SetFocus</span></font></p>
<p class=MsoNormal><font size=2 color="#333399" face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;color:#333399'>End If</span></font></p>
<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'>I receive the message box, but the focus automatically
moves to the next record.</span></font></p>
<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'>How can I keep the focus on the current record? I tried
moving the code to the BeforeUpdate event, but the same results.</span></font></p>
<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'> </span></font></p>
<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'>TIA,</span></font></p>
<p class=MsoAutoSig><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'>Mark Boyd</span></font></p>
<p class=MsoAutoSig><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'>Sr. Systems Analyst</span></font></p>
<p class=MsoAutoSig><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'>McBee Associates, Inc.</span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
</div>
</body>
</html>