[AccessD] Conditional IF for display of Sub report

Gustav Brock gustav at cactus.dk
Tue May 18 03:25:52 CDT 2004


Hi Connie

First "true" must be True as:

  Report.subreport3.Visible = True

Also, you may need to hide the subreport:

  Dim booStatus As Boolean

  booStatus = (Me.Status = "Approved")
  Report.subreport3.Visible = booStatus
  Report.subreport2.Visible = Not booStatus

/gustav


> I am trying to hide/show a subreport depending on the value of a field in
> the main report.

> It is a report on animal licences and if the report is approved I need to
> show conditions of approval, if refused grounds for refusal. Both of which
> are set up in sub reports named subreport2 and subreport3. The decision is
> shown on the main report as a field named Status.

> I have been trying to add it to the report open as follows but am getting
> an error on the value of the Status any comments or  help appreciated.


> Private Sub Report_Open(Cancel As Integer)

> If Me.Status = "Approved" Then Report.subreport3.Visible = "true" Else:
> Report.subreport2.Visible = "true"

> End Sub


> Connie Kamrowski




More information about the AccessD mailing list