DharmeshKP
New Member
- Joined
- Feb 15, 2020
- Messages
- 34
- Office Version
- 2007
- Platform
- Windows
I have user form for patient data entry
I want to validate phone to to 10 digit numeric form
I havel following dode
I run fine
No error is there
Only problem is if wrong entry done, it removes it and curser moves to next textbox
I need curser in same text box so that user is forced to fill proper data
I want to validate phone to to 10 digit numeric form
I havel following dode
I run fine
No error is there
Only problem is if wrong entry done, it removes it and curser moves to next textbox
I need curser in same text box so that user is forced to fill proper data
VBA Code:
Private Sub TextBox8_afterupdate()
If Not IsNumeric(TextBox8.Value) Or Len(TextBox8.Text) <> 10 Then
TextBox8.Text = ""
TextBox8.SetFocus
End If
End Sub