hiding multiple columns
TRANSCRIPT
-
8/17/2019 Hiding Multiple Columns
1/1
Sometimes you want to control the visibility (or other property) of one controlto be based on the value in another. This is the type of code you would use: Code:
If Me.ControlName = "Whatever" Then Me.OtherControlName.Visible = True
Else Me.OtherControlName.Visible = False End If
Depending on your situation, you might also want to clear the contents of the second control if you're making it invisible. You would put that code in the After Update event of the control you're testing, so that when you changed the value it would execute the code. You might also want the code in the Current event,which would fire when you change records.
Similarly, to set a value in one control when another is changed (setting back i
s optional). In this case the first control is a check box and the second is adate: Code:
If Me.CheckboxName = True Then Me.OtherControlName = Date() Else Me.OtherControlName = Null End If