jeudi 17 décembre 2020

hide or show one subfrm in Access 2016

how to hide or show a particular subfrm: i have 3 checkboxs(cbl_1, cbl_2 and cbl_3) and recpectively 3 subforms (Subfrm_1, subfrm_2 and subfrm_3) In my Main-form (frm_Main) have the 3 checkboxes and in the Subform have included all 3 Subforms for each checkbox have insert this private Sub

**

private Sub cbl_1_Click() '2 for cbl_2 and subfrm_2, cbl_3 for subfrm_3
'On current event of main form
'Check if Active checkbox is selected
'then show or hide subform
    If Me!cbl_1 = True Then
        Me!Subfrm_1.Visible = True
    Else
        Me.Subfrm_1.Visible = False
    End If
End Sub

**

to hide /show the subfrm, the procedure is working, but the issue is : Actually the default View is all 3 subfrms are visible. i want to start(default with an empty view in the subfrm(no subfrm) but after the checkbox is check, will appear only the recpective subfrm (cbl_1 checked, appear only subfrm1(a new dataset)




Aucun commentaire:

Enregistrer un commentaire