Please look at my code below. For some reason when the msgbox opens and the user closes it, the user has to click back into the textbox.. I know this is a simple fix but I can't think of it right now.
Code:
Private Sub txtfirstname_Change()
txtfirstname.Text = UCase$(Left(txtfirstname.Text, 1)) & LCase$(Mid$(txtfirstname.Text, 2))
txtfirstname.SelStart = Len(txtfirstname.Text)
Dim lChr As Long
With Selection
For lChr = 97 To 122
.Replace Chr(lChr), UCase(Chr(lChr))
Next lChr
End With
If TypeName(Me.ActiveControl) = "TextBox" Then
If ActiveControl = vbNullString Then Exit Sub
If IsNumeric(ActiveControl) Then
MsgBox "Sorry, text only"
ActiveControl = vbNullString
bNumbers = True
End If
End If
End Sub