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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide Control in Report Page Header 1

Status
Not open for further replies.

TimTDP

Technical User
Feb 15, 2004
373
ZA
How do I hide a control in a report's page header if the value of the controls = a criterea?

I have tried:

dim WClause as string

WClause = "NoShow"

if me.strCustomer = "NoShow" Then
me.strCustomer.Visible = True
Else
me.strCustomer.Visible = False
End If

but strCustomer does not like the attribute .visible!

Many thanks
 
I just copied your code and it worked fine for me as it is, but it really is overkill for what you need to do - you do not need to declare a variable. Having said that, you should make sure to rename your form controls so they don't have the same name as the fields. It seemed to me you asked to turn off visibility if a criteria is true, then your example turned it on if the criteria was true. If the following does the opposite of what you want, get rid of the Not.

Code:
Me.txtCustomer.Visible = Not (Me.txtCustomer.Value = "No Show")
 
I still can't get it to work!

Where did you place your code?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top