TheWebDataGuy
MIS
I am trying to validate the user entry in one of the form fields.
I have written my SUB in the LostFocus event. My problem is I am not able to return the focus on the field to be validated. Once the user clicks OK on the error message the focus shift to the next control on TabIndex.:
Private Sub txtLogID_LostFocus()
If IsNull(txtLogID) Then
MsgBox "LogID cannot be empty", vbOKOnly, "LogID"
If Response = vbOK Then
Me.txtLogID.SetFocus
End If
End If
End Sub
WHY????
Thanks
I have written my SUB in the LostFocus event. My problem is I am not able to return the focus on the field to be validated. Once the user clicks OK on the error message the focus shift to the next control on TabIndex.:
Private Sub txtLogID_LostFocus()
If IsNull(txtLogID) Then
MsgBox "LogID cannot be empty", vbOKOnly, "LogID"
If Response = vbOK Then
Me.txtLogID.SetFocus
End If
End If
End Sub
WHY????
Thanks