Enabling/disabling subforms conditionally

andreas_udby

Registered User.
Local time
Today, 09:56
Joined
May 7, 2001
Messages
76
I'm sure there's a way to do this, but I haven't been able to figure it out. I have a form with a combo box and five subforms on it (numbered 1 through 5). If a user selects "3" from the combo box, for example, I want subform4 and subform 5 to be inaccessible to the user; I figured that I could find a way using VBA code and the .Visible property to do this, but it doesn't seem to work. Can someone point me in the right direction?

Thanks,
Andreas
 
Andreas

Private Sub cboComboBoxName_AfterUpdate()
Select Case cboComboBoxName
Case 1
Case 2
Case 3
Me.SubForm4.visible = false
Me.SubForm5.visible = false
Case 4
...
End Select
End Sub

If you are currently doing something like this and it is not working, then show us your code.

Peter
 

Users who are viewing this thread

Back
Top Bottom