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

Report Property Visible on Condition

Status
Not open for further replies.

fermerius

Technical User
May 14, 2011
1
LV
Hi!
I have a report, it contains fields Player and winnings. So each Player has a winning. And it looks like this:

Player_id - winnings
Jack - 50000
John - 25000
Ros - 45000
Joey - 31000

And I want to hide player_id field, for players whose winnings is less than 30000. I've tried this:

If Reports!Player!winnings < 30000 Then Reports!Player!Player_ID.Visible = 0

As I understand it this condition can't be met because it operates with the whole column of values... and thus condition Reports![Player1]![winnings]<30000 is incorrect. It would work fine if you want to hide the whole Player_id column, but I need to hide just some of them.

Is there anyway I can do it ?
 
You could add code to the On Format event of the report section containing the controls:
Code:
  Me.Player_ID.Visible = Me.Winnings > 300000
You could also set the control source of the Player_ID text box to
Code:
=IIf([Winnings]>30000,[Player_ID],Null)
Make sure the name of the text box is not the name of a field.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top