Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help hiding objects in a report 2

Status
Not open for further replies.

SmallTime

Technical User
May 17, 2004
127
GB
Hi all,

I have a report which contains, as you would expect, a number of text box's labels and memo fields, one of which is called "TxtRelship". What I want to do is hide certain labels and other text box's depending on the value of "TxtRelship".

I can do this on a form Ok using an 'If Then' statement and setting .visible for the field I want to hide. However I notice that on the 'On Format' event of the report the .visible isn't available.

How would I go about achieving this?

Regards
 
Hi, you should be able to do that in the reports detail format event:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

select case TxtRelshi

Case is = 1
do something

Case > 1
do something

end Select


 
In the On Format event of the report, use code like:
Code:
   Me.txtA.Visible = Me.TxtRelship>1
   Me.lblA.Visible = Me.TxtRelship>1
   Me.txtC.Visible = Me.TxtRelship>3
   Me.lblC.Visible = Me.TxtRelship>3


Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top