wiklendt
i recommend chocolate
- Local time
- , 07:36
- Joined
- Mar 10, 2008
- Messages
- 1,746
ok, yes, i had just figured out myself also that it ought to be just the form name in the function parameter like Rich said.
i have modified my report slightly (prettier and layed out better), and have it all working with this code (i would have posted this before, but i didn't have internet access):
the message boxes are triggered correctly - obviously this is just a double-check that the right code is firing, which i will remove in the final version.
NB: it seems NOT to be essential to include quotation marks around the form name in the IsLoaded function.
i have modified my report slightly (prettier and layed out better), and have it all working with this code (i would have posted this before, but i didn't have internet access):
Code:
Private Sub Report_Load()
' first check whether the form with the checkbox is open
If IsLoaded("frmLISTS") Then
' then apply correct visibility property settings
If Forms!frmLISTS.chkReportDetails = False Then ' details not checked
MsgBox "Not Checked"
Me.Section(0).Visible = False ' detail section
Me.Section(3).Visible = False ' page header
Me.txtSummary_Criteria.Visible = False
Me.lblSummary_Criteria.Visible = False
Me.txtSummary_Cycle.Visible = False
Me.lblSummary_Cycle.Visible = False
Else ' details checked, show all sections
MsgBox "Checked"
End If
MsgBox "Form Loaded"
Else ' checkbox unavailable, show all sections as default
MsgBox "Form Not Loaded"
End If
End Sub
the message boxes are triggered correctly - obviously this is just a double-check that the right code is firing, which i will remove in the final version.
NB: it seems NOT to be essential to include quotation marks around the form name in the IsLoaded function.