Label or text box visibility

  • Thread starter Thread starter GD
  • Start date Start date
G

GD

I've set a label on my report to no visibility. Now I need to code it to be
visible based on a Yes/No field (RequestPaidBack) from the source table.
This one doesn't seem to work:

Private Sub Report_OnFormat()
If Me.RequestPaidback = True Then
Me.lblDeniedTitle.Visible = True
Else
Me.lblDeniedTitle.Visible = False
End If

End Sub

Any help? Thanks!!!
 
Change your label to a textbox and in the control source of the textbox,
put:

=IIf([RequestPaidBack],"YourLabeltext"," ")

Damon
 
Access is very "helpful"... in Reports, it does not carry along Fields from
the Source that are not displayed on the report, so your reference to a
Field in the RecordSource is not "seeing" the Yes/No field. If you put it in
an always-invisible text box on the Report, you can refer to either that
Field in the RecordSource or to the TextBox and the code will "see" it, and
your code should then work as you expected.

(Just for the record: All Fields from the Record Source are available in
Forms, so your code would work fine in a Form.)

Larry Linson
Microsoft Office Access MVP
 
Back
Top