I have a report where, based on a yes/no field in the recordsource, I show or hide the address, city, state, zip.
When I call the report with print preview (DoCmd.OpenReport "rpt_FittingSheet",acViewPreview , , "ID = " & Me.Recordset.Fields("ID")), I can use the pageheader_onformat event and it will fire and format the address box correctly
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
If Me.ShowHide = 0 Then
Me.ShippingAddress.Visible = False
Me.ShippingCity.Visible = False
Me.ShippingState.Visible = False
Me.ShippingZip.Visible = False
Else
Me.ShippingAddress.Visible = True
Me.ShippingCity.Visible = True
Me.ShippingState.Visible = True
Me.ShippingZip.Visible = True
End If
When I open the report in normal view (DoCmd.OpenReport "rpt_Report", , , "ID = " & Me.Recordset.Fields("ID")) it doesnt hit the format event, how do I get it to show or hide the boxes when opened?
I also have the same question about hiding the report_footer on certain criteria like above