View Full Version : Hide a control based on another control value


skelley
08-15-2000, 02:40 PM
How can I hide a control based on the value of another control, like a check-box.

I have a field on a form that I only want the user to see if a check-box is checked.
Or maybe another control's value other than a check-box.

Jack Cowley
08-15-2000, 05:14 PM
Here is generic code that goes in the After Update event of the Check Box:

If Me![CheckboxName] = -1 then
Me![FieldToHide].Visible = False
Else
Me![FieldToHide].Visible = True
End if

If you move from record to record you may want to put similar code in the On Current event to be sure you 'hidden' field is shown when you want it to be shown.

HTH,
Jack