If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Making Subform Visible On One record Only
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 |
#2
|
|||
|
|||
Making Subform Visible On One record Only
On Wed, 17 Mar 2010 13:23:01 -0700, Brian
wrote: 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 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 |
#3
|
|||
|
|||
Making Subform Visible On One record Only
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. "Brian" wrote: 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 |
Thread Tools | |
Display Modes | |
|
|