I have this code on a TextBox on a form in the 'On Exit' event.
The If (Systolic) > 999 Then, executes and the message is displayed.
The focus is not set to the Systolic text Box, it is set to the next text box on the form.
I tried 3 versions of the SetFocus.
Can any one please tell me what the problem is?
Private Sub Systolic_Exit(Cancel As Integer)
If IsNull(Systolic) Then
MsgBox "Enter a Systolic"
Forms![frm Blood Pressures]!Systolic.SetFocus
End If
If (Systolic) > 999 Then
MsgBox "Systolic Greater Than 999"
Forms![frm Blood Pressures]!Systolic.SetFocus
Me!Systolic.SetFocus
Systolic.SetFocus
End If
If (Systolic) < 1 Then
MsgBox "Systolic Less Then 1"
Forms![frm Blood Pressures]!Systolic.SetFocus
End If
End Sub
The If (Systolic) > 999 Then, executes and the message is displayed.
The focus is not set to the Systolic text Box, it is set to the next text box on the form.
I tried 3 versions of the SetFocus.
Can any one please tell me what the problem is?
Private Sub Systolic_Exit(Cancel As Integer)
If IsNull(Systolic) Then
MsgBox "Enter a Systolic"
Forms![frm Blood Pressures]!Systolic.SetFocus
End If
If (Systolic) > 999 Then
MsgBox "Systolic Greater Than 999"
Forms![frm Blood Pressures]!Systolic.SetFocus
Me!Systolic.SetFocus
Systolic.SetFocus
End If
If (Systolic) < 1 Then
MsgBox "Systolic Less Then 1"
Forms![frm Blood Pressures]!Systolic.SetFocus
End If
End Sub