Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access 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 January 5th, 2011, 03:51 PM
Authorized User
 
Join Date: Jul 2007
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Invisible field on a report

In a report on a certain condition i want the field to be invisible
and the code is :
If Me.Field1 = 1 then
Me.Field2.Visible = False
End if
But the problem is that when I type Me.Field2.
the word Visible doesn't appear on the list.

I use Access 2003.
 
Old January 5th, 2011, 04:44 PM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

You set the visible property for controls on forms and report, not fields in the record soruce.

You can view the property sheet for the control. Look on the other tab to get a control's name.


You would use somethind like this:

Code:
If Me.ControlName1 = 1 then
   Me.ControlName2.Visible = False
Else
   Me.ControlName2.Visible = True
End if
or You can use this one line of code:
Code:
   Me.ControlName2.Visible = Not (Me.ControlName1 = 1)
TIP:
Fields are in tables
Controls are on Forms and reports.
Controls can be bound to Fields in a form/report's record source.
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015
 
Old January 5th, 2011, 05:19 PM
Authorized User
 
Join Date: Jul 2007
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Invisible field on a report

Thanks a lot.

I've tried without a condition and found that the visible=false worked.

Than I made a condition that if the value is Null than visible=false ELSE visible=True.

Great stuff





Similar Threads
Thread Thread Starter Forum Replies Last Post
Invisible Post-processing chroniclemaster1 ASP.NET 3.5 Basics 2 August 19th, 2010 10:19 PM
Invisible List Item? The Duke ASP.NET 3.5 Professionals 0 September 1st, 2008 12:14 PM
visible/invisible stealthdevil Access VBA 4 December 1st, 2006 05:40 PM
Underscore to be invisible jmaronilla Beginning PHP 2 September 15th, 2004 09:37 AM
Invisible HyperLink acko ASP.NET 1.x and 2.0 Application Design 2 January 19th, 2004 01:00 PM





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