I have a text box. I want it where an user cannot enter
in a number over "5,000" Thanks
-Matthew
Printable View
I have a text box. I want it where an user cannot enter
in a number over "5,000" Thanks
-Matthew
How about this:
Just off the top of my head.Code:Private Sub Text1_Change()
Static stsPrevValue As String
If Text1.Text <> vbNullString Then
If IsNumeric(Text1.Text) = False Then
Text1.Text = stsPrevValue
ElseIf CDbl(Text1.Text) > 5000 Then
Text1.Text = stsPrevValue
Else
stsPrevValue = Text1.Text
End If
End If
End Sub