Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help on checkbox and textbox on userform pswanie Excel Programming 1 July 27th 08 10:19 PM
checkbox and textbox help needed pswanie Excel Programming 0 July 17th 08 08:26 AM
Please Help - Checkbox Data Validation question!!! Jenny B. Excel Discussion (Misc queries) 4 July 21st 07 10:04 PM
Action Event, CheckBox, Add Row and Textbox Ryan Excel Discussion (Misc queries) 2 July 17th 07 02:32 PM
Excel VBA - Userform Checkbox/Textbox Problem Thunder5 Excel Programming 1 February 16th 04 02:06 PM


All times are GMT +1. The time now is 11:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"