Hi guys
I have two textboxes
1. txtpolno
2. Textbox5
I am writing the following code to double check if the person has inputted the right policy number. If yes then the cursor should move to the next control but if not then the above two textboxes shoule be blank and the focus should be at txtPolNo.But the code moves the focus to the next control always.
![]()
Private Sub TextBox5_Exit(ByVal Cancel As MSForms.ReturnBoolean) If txtPolNo.Value <> TextBox5.Value Then MsgBox "The Policy numbers don't match with each other" TextBox5.Value = "" txtPolNo.Value = "" txtPolNo.SetFocus Cancel = True End If End Sub
Bookmarks