View Full Version : Remove a sub-form by a choice from a combo box


Ants
08-03-2000, 01:45 AM
Within a form I have a combo box and a sub-form. If I choose a particular choice from the list available from the combo box, I do not want the sub-form to be visible. How do I go about it?

Shall look forward to any comments and advices!

Travis
08-03-2000, 11:44 AM
on the AfterUpdate of your combobox when it equals the value that you want the Subform to not be visible set the SubForm Visible property to False. In this case you will need to add the code to make its visible property to True.

Private Sub MyCombo_AfterUpdate()
If Me.MyCombo="Dont Show Combo Value" then
Me.[Name of Subform Control].Visible=False
else
Me.[Name of Subform Control].Visible=true
end if

End Sub