Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox Validation and Associated Checkbox
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need help on checkbox and textbox on userform | Excel Programming | |||
checkbox and textbox help needed | Excel Programming | |||
Please Help - Checkbox Data Validation question!!! | Excel Discussion (Misc queries) | |||
Action Event, CheckBox, Add Row and Textbox | Excel Discussion (Misc queries) | |||
Excel VBA - Userform Checkbox/Textbox Problem | Excel Programming |