Text box value is null unless corresponding check box is checked

utmigs

New member
Local time
Today, 07:47
Joined
Nov 17, 2004
Messages
6
I'm trying to make a form that provides criteria for a query. There are 5 items listed that the user can search with. I want the user to be able to check the items they would like to search with, then type in the criteria. I was wondering if there was a way to only allow a value in the corresponding text field if the check box is checked, and if it is unchecked to produce a null or "" value. Thanks.
 
Could you just change the Enabled property of the Criteria boxes? For the On Click event of each check box, use something like this:

If Me.CheckBox1 = 0 Then
Me.CriteriaField1 = Null
Me.CriteriaField1.Enabled = False
Else
Me.CriteriaField1.Enabled = True
End If
 

Users who are viewing this thread

Back
Top Bottom