Re: MS Access Reports = Hide Details
I have a form that passes criteria to a Report.
The form has an UNBOUND check box named Forms![QBF_Form01]![HideDetail]
Whether the box is checked or not, I always get Report with full details
I want to offer the user two Report options - one with Detail and one without
Novice here - have not been able to suppress report details using any of the methods below:
-
- In the Details section of the Report
In the Event section - "On Format" field reads "Cancel = Forms![QBF_Form01]![HideDetail]"
Running report from form, all records are displayed - Doesn't seem to Cancel "On Format"
-
- VBA Code - From the VB editor from within Access, the "tree" on the left of the Code pane:
MS Office Access Class Object
Report_QBF_Report01
Detail:Format
In the Code pane, the Code reads:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Forms![QBF_Form01]![HideDetail].Value = True Then
Detail.Visible = False
End If
End Sub
have tried with and without square brackets [ ]
Consistently produces report with all details
-
- Me.Section(0).Visible = Forms![YourFormName]![YourControlName]
Found this elsewhere..."Me.Section(0).Visible = Forms![YourFormName]![YourControlName]
Put the code in the Open event of the Report, not the form. It will
reference the form for the true or false to display the detail."
I put the following code in the "On Open" event for the Report:
Me.Section(0).Visible = Forms![QBF_Form01]![HideDetail]
Upon filling the form, click to Run, Access returns:
MS Acces cannot find Object 'Me' - Stalls - No output at all
I'm almost ready to make two reports - but it seems there should be a better way to interpret a "tick" for Details.
I am grateful for any help!
GG