hide subform based on field value

lscheer

Registered User.
Local time
Today, 12:00
Joined
Jan 20, 2000
Messages
185
I have a subform that I want to make inaccessible (either invisible or disabled) based on the value of a field on the main form. I have tried this code, but it doesn't seem to work. Any ideas?

Private Sub Form_Activate()
If Forms!frmAQApplicants!StillInField = "No" Then
Me!sbfAQInviteeList!InviteeList.Enabled = False
Me!sbfAQInviteeList!InviteeList.Visible = False
Else
Me!sbfAQInviteeList!InviteeList.Enabled = True

End If


End Sub

PS-the other important part of this is the event that triggers it...I'd like this to happen whenever the form is open/active to prevent data entry into the subform.

Thanks!
 
Use the main form current event, don't forget to set the form visible to true when required, also if this as the result of a checkbox there are no quotes around No.
This method may annoy/confuse users though
 

Users who are viewing this thread

Back
Top Bottom