H
harpscardiff
I'm having a problem with my validation I set. Basically if policy
number textbox is not 8 digits long then msgbox retry. It should let me
go back to the textbox and update . The problem I am having is, I click
retry and it moves to next textbox and I dont know why
Below is the code:
Any ideas what is wrong?
Thanks
Code:
--------------------
Public Sub txtpolicynumber_AfterUpdate()
Dim Policynumber, Msg, Style, Title, Response, CheckRetry As String
Msg = "Invalid Entry. Must be 8 digits long"
Style = vbRetry + vbCritical
Title = "Data Validation"
Response = Msgbox(Msg, Style, Title)
CheckRetry = vbRetry
Policynumber = txtpolicynumber.Value
If Len(Policynumber) <> 8 Then
Response = Msgbox(Msg, Style, Title)
txtpolicynumber.SetFocus
End If
End Sub
number textbox is not 8 digits long then msgbox retry. It should let me
go back to the textbox and update . The problem I am having is, I click
retry and it moves to next textbox and I dont know why
Below is the code:
Any ideas what is wrong?
Thanks
Code:
--------------------
Public Sub txtpolicynumber_AfterUpdate()
Dim Policynumber, Msg, Style, Title, Response, CheckRetry As String
Msg = "Invalid Entry. Must be 8 digits long"
Style = vbRetry + vbCritical
Title = "Data Validation"
Response = Msgbox(Msg, Style, Title)
CheckRetry = vbRetry
Policynumber = txtpolicynumber.Value
If Len(Policynumber) <> 8 Then
Response = Msgbox(Msg, Style, Title)
txtpolicynumber.SetFocus
End If
End Sub