Hi, I have a checkbox for "N/A" and a textbox for storing input.

I have the following code checking to make sure the textbox stores a
numeric input:

Private Sub TextBox2_BeforeUpdate(ByVal Cancel As
MSForms.ReturnBoolean)
    If IsNumeric(TextBox2.Value) Then
        ErrOmTxt = TextBox2.Value
        Cancel = False
    Else
        MsgBox "Errors and Omissions value must be numeric.  Please
check and re-enter, or check N/A for no coverage."
        TextBox2.Value = ""
        TextBox2.SetFocus
        Cancel = True
    End If
    Exit Sub
End Sub

Basically, if the data is valid, store it in a String variable.
Otherwise, clear the textbox, and allow the user to enter a new value
or to check the checkbox.  Checking the N/A checkbox will set
Textbox2.Enabled = False

However, in testing--when I type in alpha characters, my msgbox will
pop up, but I cannot proceed to check the checkbox.  I get stuck at
this step until I close the userform.

Any ideas?
Thanks in advance.

--~--~---------~--~----~------------~-------~--~----~
-------------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
-------------------------------------------------------------------------------------
-~----------~----~----~----~------~----~------~--~---

Reply via email to