bry said:
How do you toggle the detail section property of a report
from visible=yes to visible=no from a toggle button on a
form.
Assuming that the form is open when ever the report is run...
Me.Section(0).Visible = Forms!FormName!ControlName
In the above example the ControlName would be the name of your ToggleButton
and the toggle would be True when you want to see the detail section and
False when you don't. You might also want to test this with the Cancel
argument of the detail section's Format event.
Cancel = Forms!FormName!ControlName
In this case the True/False result is reversed. A True toggle results in
the section not appearing and a False toggle will cause the section to be
processed as normal. You can insert the NOT keyword if you want the
opposite result.
The difference is that setting the visible property to false will still
leave a blank area on the report equal in size to the detail section
whereas canceling the format event of the section will not only hide it,
but it will also not take up any vertical space on the output.