G
Guest
Hi....I have a control that is numeric (integer). I want to make sure user
enters only 6 digit number not more or less. If they enter less then the
system should display a message and setfocus back to that field. I wrote the
code below and it works but it doesn't set the focus to the field. It goes
back to the next field in tab index.
Private Sub tblClient_CID_AfterUpdate()
If Len(Me.tblClient_CID) <> 6 Then
MsgBox "Invalid CID. Please Reenter.", vbCritical, "AE Client
Relationship Management"
Me!tblClient_CID.SetFocus
End If
End Sub
enters only 6 digit number not more or less. If they enter less then the
system should display a message and setfocus back to that field. I wrote the
code below and it works but it doesn't set the focus to the field. It goes
back to the next field in tab index.
Private Sub tblClient_CID_AfterUpdate()
If Len(Me.tblClient_CID) <> 6 Then
MsgBox "Invalid CID. Please Reenter.", vbCritical, "AE Client
Relationship Management"
Me!tblClient_CID.SetFocus
End If
End Sub