I have a textbox where a user will enter a name (one for first name, another textbox for last name.) My SQL will concatenate them (LName & ", " & FName)
anyway - I thought it would be nice to capitalize the name in case the user didn't. I did this using an input mask of ">L<??????????????"
I also wanted to "validate" the text to be sure the user did not enter a number.
I used this to do that:
Here is my question:
1. because of the input mask, if the user "clicks" in the textbox, the cursor is located where ever the user clicked. Any text that is entered and it doesn't start at the first position, it errors out.
2. I assume that the input mask is also preventing the "validation" from working properly, as if you do enter a number, and tab to the next control, the textbox is "empty".
Is there any way to force the cursor to be at the first position when a user selects a text box? This would solve issue number one anyway.
Is there a better way to capitalize the first letter?
anyway - I thought it would be nice to capitalize the name in case the user didn't. I did this using an input mask of ">L<??????????????"
I also wanted to "validate" the text to be sure the user did not enter a number.
I used this to do that:
Code:
Private Sub txtFirstName_Exit(Cancel As Integer)
If IsNumeric(txtFirstName.Value) Then
MsgBox "Please enter a Name only.", vbInformation, "Error"
txtRoutingNo.Value = ""
Cancel = True
Exit Sub
End If
End Sub
Here is my question:
1. because of the input mask, if the user "clicks" in the textbox, the cursor is located where ever the user clicked. Any text that is entered and it doesn't start at the first position, it errors out.
2. I assume that the input mask is also preventing the "validation" from working properly, as if you do enter a number, and tab to the next control, the textbox is "empty".
Is there any way to force the cursor to be at the first position when a user selects a text box? This would solve issue number one anyway.
Is there a better way to capitalize the first letter?