JayDawg wrote:
I appreciate your assistance and I am sure you are pointing me in the
right direction, but this didnt work for me, probably because I did
something wrong. I dont know VBA real well, can you send me a little
more step by step directions as to what I am suppossed to do. Where do
I put the code on the details section of the form?
Try this one...
Private Sub chkShowSubform_Click()
Me![SuppliesNeed].Form.Visible = Me.chkShowSubform
End Sub
I have the checkbox "chkShowSubform" on my main form.
The subform is called "SuppliesNeed".
"Me" refers to the form the checkbox is on. (the main form)
So, the ShowSubform stuff is...
MainformName![SubformName].Form
Visible is a property of the subform.
I'm just setting the value of it to the value of the checkbox on the
main form, (in VB shorthand, "Me")
If you want the visible property of the subform to change depending on
the value of the current record, you have to force the Visible property
to be reevaluated in the Current event of the form.
So in the Current event of the Main form, put this code:
Me![SuppliesNeed].Form.Visible = Me.chkShowSubform
(yes, it's the same code as for the checkbox.)
test it out... does it work now?