locking textbox?!
Jason,
1) Can you wait until the user clicks a commandbutton (OK/Done button) and
then validate the textbox.
2) Can you use the Textbox_Exit event?(see code below) I don't know if your
design fits this usage (requires the user to hit enter or tab to another
control).
Troy
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim sValue As String
Dim dblValue As Double
sValue = Me.TextBox1.Value
If IsNumeric(sValue) Then
dblValue = CDbl(sValue)
If dblValue <= 0 Or dblValue = 10 Then
MsgBox "Please enter a number between 0 and 10"
Cancel = True
End If
Else
MsgBox "Please enter a numeric value"
Cancel = True
End If
End Sub
"jason" wrote in message
om...
Hello All,
i have a textbox that has to have a number entered into it that is 0
& <10.
i can quite easily write a longish routine in the textbox_change event
procedure using isnumeric & len() to test each new character that the
user inputs into the textbox
; but is there a quicker solution?
Thanks in advance
Jason
|