Suppressing textboxes in a report

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
 
D

Duane Hookom

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.
 
D

Dave

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top