Making Subform Visible On One record Only

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

I have an invoice form with a check box which when =True executes a macro to
make a subform visible for additional entries.
Although the macro works, when run, it displays the subform on ALL records
even those records where the check box remains =False.
I only want the subform visble on Check Box=True records.
The check Box is a bound Control in the underlying table.
I've tried various solutions but not got it working yet.

Gordon
 
On Wed, 17 Mar 2010 13:23:01 -0700, Brian

You can use this one-liner in the Form_Current event:
Me.mySubformControl.Visible = Me.myCheckboxField
(of course you replace myObjectNames with yours)

-Tom.
Microsoft Access MVP
 
go to the properties for the subform in you main form and set visible to false,

then in the on change event for you check box put the following code

Private Sub checkBoxName_AfterUpdate()
If Me.checkBoxName = True Then
Me.[childFormName].Visible = True
Else
Me.[childFormName].Visible = False
End If
End Sub

I tested this and it does what it seems like you are explaining in your post.
 
Back
Top