I
ivory_kitten
I have a text box which uses IsNumeric to validate the text, however if the
user types a number in the box and then wants to change it back to blank,
it's not allowed, the msg box keeps coming up, how do I add to it to stop
that and allow the value to be deleted from the field and left blank.
This is the code
Private Sub RemovalCost2_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
Dim strtext As String
strtext = Me.RemovalCost2.Text
If Not IsNumeric(strtext) Then
MsgBox "Please enter a valid number", vbInformation
Cancel = True
Else
Me.RemovalCost2.Text = Format(strtext, "$###,##0.00")
Cancel = False
End If
End Sub
Thanks in advance
user types a number in the box and then wants to change it back to blank,
it's not allowed, the msg box keeps coming up, how do I add to it to stop
that and allow the value to be deleted from the field and left blank.
This is the code
Private Sub RemovalCost2_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
Dim strtext As String
strtext = Me.RemovalCost2.Text
If Not IsNumeric(strtext) Then
MsgBox "Please enter a valid number", vbInformation
Cancel = True
Else
Me.RemovalCost2.Text = Format(strtext, "$###,##0.00")
Cancel = False
End If
End Sub
Thanks in advance