Do not allow entry in textbox depending on Combobox Selection

mikerea90

Registered User.
Local time
Today, 09:15
Joined
Jun 30, 2009
Messages
92
Hello all,

I have been looking for a while, maybe I am not phrasing this correctly.

I am working on a survey and I have a combobox where the user is asked a yes/no question. They choose yes or no. If they choose 'no' then they can explain why they chose 'no' in the following textbox, but if they choose 'yes' I want to make sure the textbox cannot have data entered into it. How do you prevent data entry when 'yes' is selected??

Thanks in advance!
 
You'll probably also want to clear the text box

Me.TextBoxNameHere = ""

if Yes is selected (just in case there was a value there).
 
Thank you, but I am still confused about how I would lock the textbox. The code shows me how to create the event, but I am still unsure how to make the textbox 'not enterable.'
 
Or I would just make it invisible.
Code:
If Me.ComboBoxName = "Yes" Then
   Me.TextBox = ""
   Me.TextBox.Visible = False
Else
  Me.TextBox.Visible = True
End If
 

Users who are viewing this thread

Back
Top Bottom