Dirty Error on Visible

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to make a subreport visible or not according to the content of a
field in the main report, but I get "You have entered an expression that has
an invalid reference to the property Dirty." Here is the On Format code:

Select Case CoverAuthor
Case "President"
Me.PRES.Form.Visible = True
Case "Chancellor-Knox"
Me.KNOX.Form.Visible = True
Case ...
End Select
 
If "PRES" and "KNOX" refer to Subreport Controls on the main Report, use the
following:

Select Case CoverAuthor
Case "President"
Me.PRES.Visible = True
Case "Chancellor-Knox"
Me.KNOX.Visible = True
Case ...
End Select

I have never tried setting the visibility of the Form property of a
Subreport Control, but I often set visibility of a Subreport Control itself
to accomplish what you describe. (In my databases, those Controls would be
prefixed with "sbr" to indicate a Control of type Subreport, or "sbf" to
indicate a Control of type Subform.)

Larry Linson
Microsoft Access MVP
 
Back
Top