Hiding Fields on Reports

  • Thread starter Thread starter Kitty
  • Start date Start date
K

Kitty

I have two sets of fields that I want to show or hide,
depending on a separate indicator field. The report
prints various information on one page for each record in
the recordset (data source is an SQL statement).

The problem is that once one of the sets of data appears,
it doesn't go away, even if it doesn't apply to the next
record on the report.

The code below is in the On Format event of the Detail
section.

If Me.ARP_CONCUR = "N" Then
Me.lblReasons.Visible = True
Me.lblICRClass.Visible = True
Me.lblICRGrade.Visible = True
Me.lblICRAdmin.Visible = True
Me.lblICROther.Visible = True
Me.txtICRClass.Visible = True
Me.txtICRGrade.Visible = True
Me.txtICRAdmin.Visible = True
Me.txtICROther.Visible = True
End If
If Me.CONCUR_CC = "N" Then
Me.lblCrClass.Visible = True
Me.lblRevClass.Visible = True
Me.txtClass.Visible = True
Me.txtRevClass.Visible = True
End If

Thanks for your help.
Kitty
 
I have two sets of fields that I want to show or hide,
depending on a separate indicator field. The report
prints various information on one page for each record in
the recordset (data source is an SQL statement).

The problem is that once one of the sets of data appears,
it doesn't go away, even if it doesn't apply to the next
record on the report.

The code below is in the On Format event of the Detail
section.

If Me.ARP_CONCUR = "N" Then
Me.lblReasons.Visible = True
Me.lblICRClass.Visible = True
Me.lblICRGrade.Visible = True
Me.lblICRAdmin.Visible = True
Me.lblICROther.Visible = True
Me.txtICRClass.Visible = True
Me.txtICRGrade.Visible = True
Me.txtICRAdmin.Visible = True
Me.txtICROther.Visible = True
End If
If Me.CONCUR_CC = "N" Then
Me.lblCrClass.Visible = True
Me.lblRevClass.Visible = True
Me.txtClass.Visible = True
Me.txtRevClass.Visible = True
End If

Thanks for your help.
Kitty

Once you make the controls visible, you must then make them not
visible when the criteria doesn't apply:

If Me.ARP_CONCUR = "N" Then
Me.lblReasons.Visible = True
Me.lblICRClass.Visible = True
...etc......
Else
Me.lblReasons.Visible = False
Me.lblICRClass.Visible = False
...etc......
End If

If Me.CONCUR_CC = "N" Then
Me.lblCrClass.Visible = True
Me.lblRevClass.Visible = True
Me.txtClass.Visible = True
Me.txtRevClass.Visible = True
Else
Me.lblCrClass.Visible = False
Me.lblRevClass.Visible = False
Me.txtClass.Visible = False
Me.txtRevClass.Visible = False

End If
 
Thanks, Fred. Works perfectly.

-----Original Message-----


Once you make the controls visible, you must then make them not
visible when the criteria doesn't apply:

If Me.ARP_CONCUR = "N" Then
Me.lblReasons.Visible = True
Me.lblICRClass.Visible = True
...etc......
Else
Me.lblReasons.Visible = False
Me.lblICRClass.Visible = False
...etc......
End If

If Me.CONCUR_CC = "N" Then
Me.lblCrClass.Visible = True
Me.lblRevClass.Visible = True
Me.txtClass.Visible = True
Me.txtRevClass.Visible = True
Else
Me.lblCrClass.Visible = False
Me.lblRevClass.Visible = False
Me.txtClass.Visible = False
Me.txtRevClass.Visible = False

End If

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
Back
Top