The reason I decided to use a button, is so I could have a second
button to turn it back to False. If I use the AfterUpdate, how would I
t urn it off?
Dim c As Control
For Each c In Me.Controls
If c.Name = ComboName.Value Then
c.Visible = Not C.Visible
Exit Sub
End If
Next
In this case, code the command button that loads the not visible
controls into the combo box:
Me.ComboName.Rowsource = ""
Dim c As Control
For Each c In Controls
If c.Properties("Visible") = False Then
ComboName.RowSource = ComboName.RowSource & c.Name & ","
End If
Next c
If Len(ComboName.Rowsource) > 0 Then
ComboName.RowSource = Left(ComboName.RowSource,
Len(ComboName.RowSource) - 1)
End If
Then, whenever you change a control, via the combo box, from Visible
to Not Visible, click the command button and it will re-load the combo
box and remove that now visible control from the rowsource.