spartansFC
Programmer
Hi
I have a report with a subreport and what i need is for the subreport not to be visible when i user selects a check box. The way everything is set up is:
Letter 1 : Allocation of Funding - based on qryLetter1Allocation of Funding
rptLetter1AllocationofFundingSub - based on qryLetter1AllocationofFundingSub
the report and subreport are linked child/master by lngChildID
so when the user selects the report a piece of code kicks in on the OnOpen event of the report
on this frmLetter1SelectionOptions there is a chkbox
so what is supposed to happen is even if the subreport has data in, we might not want it to be shown, so the user would tick this check box.
On the format event on the detail section of the main report i have:
I do reset all the chkboxes on the onclose event of the report via:
No matter if i check the box or not, the subreport is still displayed. Please someone put me out of my misery and tell me what i'm doing wrong.
Thanks
Michael
I have a report with a subreport and what i need is for the subreport not to be visible when i user selects a check box. The way everything is set up is:
Letter 1 : Allocation of Funding - based on qryLetter1Allocation of Funding
rptLetter1AllocationofFundingSub - based on qryLetter1AllocationofFundingSub
the report and subreport are linked child/master by lngChildID
so when the user selects the report a piece of code kicks in on the OnOpen event of the report
Code:
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "frmLetter1SelectionOptions", , , , , acDialog, "Letters: Standard"
If Not IsLoaded("frmLetter1SelectionOptions") Then
Cancel = True
End If
End Sub
on this frmLetter1SelectionOptions there is a chkbox
Code:
FundingBreakdownTableYesNo
so what is supposed to happen is even if the subreport has data in, we might not want it to be shown, so the user would tick this check box.
On the format event on the detail section of the main report i have:
Code:
If [Forms]![frmLetter1SelectionOptions]![FundingBreakdownTableYesNo] = Yes Then
Me.rptLetter1AllocationofFundingSub.Visible = True
End If
If [Forms]![frmLetter1SelectionOptions]![FundingBreakdownTableYesNo] = No Then
Me.rptLetter1AllocationofFundingSub.Visible = False
End If
I do reset all the chkboxes on the onclose event of the report via:
Code:
Private Sub Report_Close()
[Forms]![frmLetter1SelectionOptions]![cmbChildSelect] = Null
[Forms]![frmLetter1SelectionOptions]![cmbMeetingDate] = Null
[Forms]![frmLetter1SelectionOptions]![Option1_chkbox] = Null
[Forms]![frmLetter1SelectionOptions]![Option1a_chkbox] = Null
[Forms]![frmLetter1SelectionOptions]![AllocatedAmount_txtbox] = Null
[Forms]![frmLetter1SelectionOptions]![AllocatedSupportto_txtbox] = Null
[Forms]![frmLetter1SelectionOptions]![OptionFurther_chkbox] = Null
[Forms]![frmLetter1SelectionOptions]![AllocatedFurther_txtbox] = Null
[Forms]![frmLetter1SelectionOptions]![AllocatedFurtherTo_txtbox] = Null
[Forms]![frmLetter1SelectionOptions]![Option2_chkbox] = Null
[Forms]![frmLetter1SelectionOptions]![OneOffPayment_txtbox] = Null
[Forms]![frmLetter1SelectionOptions]![Option3_chkbox] = Null
[Forms]![frmLetter1SelectionOptions]![NoSessions_txtbox] = Null
[Forms]![frmLetter1SelectionOptions]![Option4_chkbox] = Null
[Forms]![frmLetter1SelectionOptions]![SplitSession1_txtbox] = Null
[Forms]![frmLetter1SelectionOptions]![Option5_chkbox] = Null
[Forms]![frmLetter1SelectionOptions]![cmbTermSelection] = Null
[Forms]![frmLetter1SelectionOptions]![ApplicationSubmittedDate_txtbox] = Null
[Forms]![frmLetter1SelectionOptions]![Variations_chkbox] = Null
[Forms]![frmLetter1SelectionOptions]![FundingBreakdownTableYesNo] = Null
End Sub
No matter if i check the box or not, the subreport is still displayed. Please someone put me out of my misery and tell me what i'm doing wrong.
Thanks
Michael