Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 14th, 2011, 08:03 AM
Registered User
 
Join Date: May 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Report Visible Property

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:
Code:
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 ?
 
Old May 14th, 2011, 10:15 AM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

I assume that Player_id - winnings is printing in the detail section.

Use the Detail section's on Format event like this:

Code:
If Me.winnings < 30000 Then 
  ' Turn if off it not needed
    Me.Player_ID.Visible = False

Else
 ' Turn it on if needed
    Me.Player_ID.Visible = True

End If
or this shorthand

Code:
 Me.Player_ID.Visible = (Me.winnings >= 30000)

The key is that you have to always set the visible property to on (true) or off (false) each time.
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015
 
Old May 14th, 2011, 01:46 PM
Registered User
 
Join Date: May 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot, mate )
 
Old May 14th, 2011, 02:14 PM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

You're welcome.

Cheers.
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015





Similar Threads
Thread Thread Starter Forum Replies Last Post
Button does not retain visible property mhshpk ASP.NET 2.0 Professional 2 July 18th, 2007 11:24 AM
Word.ApplicationClass Visible Property danielv General .NET 0 January 11th, 2006 12:50 PM
Setting visible property on a report field tnzabo Access 3 July 21st, 2005 11:30 AM
Visible row property Louisa VB.NET 2002/2003 Basics 0 October 29th, 2004 04:26 AM
Visible property glitch bmains VS.NET 2002/2003 3 May 5th, 2004 02:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.