MainForm = Me
SubForm = frmFCPSYCHMEDS
Checkbox = FC_PsychMeds
This code below works fine for showing/hiding the subform based on whether cbxFC_PsychMeds is checked. The problem is when I check cbxFC_PsychMeds for one record, it makes the SubForm appear for all records rather than the related record. I want the SubForm to be visible only on the records where the checkbox is checked.
Private Sub Psychotropic_Meds_AfterUpdate()
If Me.[FC_PsychMeds] = -1 Then
Me.frmFCPSYCHMEDS.Visible = True
Else
Me.frmFCPSYCHMEDS.Visible = False
End If
End Sub
SubForm = frmFCPSYCHMEDS
Checkbox = FC_PsychMeds
This code below works fine for showing/hiding the subform based on whether cbxFC_PsychMeds is checked. The problem is when I check cbxFC_PsychMeds for one record, it makes the SubForm appear for all records rather than the related record. I want the SubForm to be visible only on the records where the checkbox is checked.
Private Sub Psychotropic_Meds_AfterUpdate()
If Me.[FC_PsychMeds] = -1 Then
Me.frmFCPSYCHMEDS.Visible = True
Else
Me.frmFCPSYCHMEDS.Visible = False
End If
End Sub