Suppressing textboxes in a report

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I have a report with a header and a detail section.

Based on the value in a textbox in the header, I want to either display or
hide textboxes in the detail section.

For example, there are 3 textboxes in the detail section. If the value of
the textbox in the header is 1, I want to display only one of the 3
textboxes in the detail section. The other two should not be visible.
However, if the value of the textbox in the header is something other than
1, then all 3 textboxes in the detail section should display.

Can any one tell me how to approach this in Access 2002?

Thanks
 
You could try code in the On Format event of the detail section like:
If Me.txtInHeader = 1 Then
Me.txtInDetail1.Visible = False
Me.txtInDetail2.Visible = True
Me.txtInDetail3.Visible = True
Else
Me.txtInDetail1.Visible = True
Me.txtInDetail2.Visible = False
Me.txtInDetail3.Visible = False
End If

Modify this code to meet your needs.
 
Thank you very much


Duane Hookom said:
You could try code in the On Format event of the detail section like:
If Me.txtInHeader = 1 Then
Me.txtInDetail1.Visible = False
Me.txtInDetail2.Visible = True
Me.txtInDetail3.Visible = True
Else
Me.txtInDetail1.Visible = True
Me.txtInDetail2.Visible = False
Me.txtInDetail3.Visible = False
End If

Modify this code to meet your needs.
 
Back
Top