In the Property box of YourTextBox set Enabled to No.
Code:
Private Sub YourCheckBox_AfterUpdate()
If YourCheckBox = -1 Then
YourTextBox.Enabled = True
Else
Me.YourTextBox = ""
YourTextBox.Enabled = False
End If
End Sub
Private Sub Form_Current()
If YourCheckBox = -1 Then
YourTextBox.Enabled = True
Else
YourTextBox.Enabled = False
End If
End Sub
If the user changes their mind and unchecks the box, the line Me.YourTextBox = "" deletes any value that may have been entered while the checkbox was checked. The checkbox nees to be bound to the underlying table.
hey buddy - I tried this code and for some reason it doesn't work. No change takes place to the text field when the checkbox is checked or unchecked. Incidentally, why do you have Me. in front of some of the field names, but not others?
hey buddy - I tried this code and for some reason it doesn't work. No change takes place to the text field when the checkbox is checked or unchecked. Incidentally, why do you have Me. in front of some of the field names, but not others?