Visible Property

I have a report that has a "project" field.  Sometimes the project field has 
data in it, and sometimes it doesn't.  I also have a running sum that counts 
the number of projects.  I want the running sum to be hidden when there is no 
project corresponding to it.  Currently, when no project is displayed, the 
running sum is still set to "1."  

This is what I've got so far...let me know if my logic is wrong...

=IIf([Project]<>"",[ProjectCounter].[Visible]=Yes,[ProjectCounter].[Visible]=No)

Thanks
0
Utf
2/29/2008 4:19:04 PM
access.reports 4434 articles. 0 followers. Follow

3 Replies
703 Views

Similar Articles

[PageSpeed] 3

Harvard wrote:

>I have a report that has a "project" field.  Sometimes the project field has 
>data in it, and sometimes it doesn't.  I also have a running sum that counts 
>the number of projects.  I want the running sum to be hidden when there is no 
>project corresponding to it.  Currently, when no project is displayed, the 
>running sum is still set to "1."  
>
>This is what I've got so far...let me know if my logic is wrong...
>
>=IIf([Project]<>"",[ProjectCounter].[Visible]=Yes,[ProjectCounter].[Visible]=No)


Setting property values is not something you can do in an
expression.  You need to use VBA code to do it.

Put this kind of code in the Format event procedure of the
section that contains the text box:

Me.ProjectCounter.Visible = (Me.Project <> "")

-- 
Marsh
MVP [MS Access]
0
Marshall
2/29/2008 5:39:35 PM
Maybe I did something wrong, but that didn't work.  I'm using Access 2007.  I 
right-clicked "projectcounter" and then clicked "build event."  from there, I 
selected Code Builder.  Then  pasted the code that you told me to put...saved 
it, and refreshed the report, but nothing happened.  Did I do something wrong?

"Marshall Barton" wrote:

> Harvard wrote:
> 
> >I have a report that has a "project" field.  Sometimes the project field has 
> >data in it, and sometimes it doesn't.  I also have a running sum that counts 
> >the number of projects.  I want the running sum to be hidden when there is no 
> >project corresponding to it.  Currently, when no project is displayed, the 
> >running sum is still set to "1."  
> >
> >This is what I've got so far...let me know if my logic is wrong...
> >
> >=IIf([Project]<>"",[ProjectCounter].[Visible]=Yes,[ProjectCounter].[Visible]=No)
> 
> 
> Setting property values is not something you can do in an
> expression.  You need to use VBA code to do it.
> 
> Put this kind of code in the Format event procedure of the
> section that contains the text box:
> 
> Me.ProjectCounter.Visible = (Me.Project <> "")
> 
> -- 
> Marsh
> MVP [MS Access]
> 
0
Utf
2/29/2008 6:28:04 PM
The Format event must be for the **section** containing the
text box.  In my opinion, the event builder often guesses
worng about what event you want to create so you can easily
mess things up using that feature.  Better to click in a
nlank are of the section near the text box and then find the
Format event **property**.  Select [Event Procedure] from
the drop list and the use the [...] button to get to the
event **procedure** where you can enter the code.

If perchance all that is what you have, then you need to
investigate the code to make sure it is really doing what
you need it to do.  For instance, you check if Project is
not "", are you sure the is not Null instead?  Maybe you
should be using:

	Me.ProjectCounter.Visible = Not IsNull(Me.Project)

or in unusual situations where it could be either "" or
Null:
	
	Me.ProjectCounter.Visible = (Nz(Me.Project, "") <> "")
-- 
Marsh
MVP [MS Access]


Harvard wrote:
>Maybe I did something wrong, but that didn't work.  I'm using Access 2007.  I 
>right-clicked "projectcounter" and then clicked "build event."  from there, I 
>selected Code Builder.  Then  pasted the code that you told me to put...saved 
>it, and refreshed the report, but nothing happened.  Did I do something wrong?
>
>"Marshall Barton" wrote:
>
>> Harvard wrote:
>> 
>> >I have a report that has a "project" field.  Sometimes the project field has 
>> >data in it, and sometimes it doesn't.  I also have a running sum that counts 
>> >the number of projects.  I want the running sum to be hidden when there is no 
>> >project corresponding to it.  Currently, when no project is displayed, the 
>> >running sum is still set to "1."  
>> >
>> >This is what I've got so far...let me know if my logic is wrong...
>> >
>> >=IIf([Project]<>"",[ProjectCounter].[Visible]=Yes,[ProjectCounter].[Visible]=No)
>> 
>> 
>> Setting property values is not something you can do in an
>> expression.  You need to use VBA code to do it.
>> 
>> Put this kind of code in the Format event procedure of the
>> section that contains the text box:
>> 
>> Me.ProjectCounter.Visible = (Me.Project <> "")
0
Marshall
2/29/2008 8:08:02 PM
Reply:

Similar Artilces:

File Properties
Is there a way to change the details in the Summary tab of the File Properties dialog box (e.g. Title / Keywords / Comments) through using a macro? Thanks, Andrew activeworkbook.BuiltinDocumentProperties("title") = "Test book" -- HTH RP (remove nothere from the email address if mailing direct) "Andrew" <Andrew@discussions.microsoft.com> wrote in message news:3986D848-BF81-4120-A878-D9B3E80E1A1D@microsoft.com... > Is there a way to change the details in the Summary tab of the File > Properties dialog box (e.g. Title / Keywords / Comments) thr...

shape property based on other shape property
I am documenting the electrical circuits in 90 some labs. I am using Visio 2007. I have created circuit shapes with the Property Types: Circuit ID and Phase. The Circuit Phase can be a number between 1 and 42. The Phase corresponds with that specific number and will be A, B, or C. I want to know how to make the Phase Property be based on the Circuit ID property. Also, there is another type of circuit, where the circuit ID lists two Circuit IDs. Same numbering as before, so an example might look like "2,4". In this case, I would need the Phase Property to be A,B. I fi...

Changing a forms properties under program control
I have a form caled "frm _Main" and that form has a Sub Form called "frm_Sub_Address" embeded in it. I am wanting to make the "frm_Sub_Address" get its information from two different Tables depending on what info the user wants. The two Tables are called "tbl_Stores" and "tbl_Suppliers". I know that you will raise the question, why do I have 2 tables containing Adddress info but putting that pointy to one side for the moment, my code is as follows, depending on what info the user wants :- iF user wants this info For...

Adding a property sheet to System Properties
Is it possible to add a property sheet to the Windows System Properties dialog? Thanks ...

can't display address properties
our envirnment is exchange2k3 sp2 and outlook2k3. In outlook,open a message,double click local domain sender/recipient, we can't get address properties,if we double click external domain sender,it's no problem. how do i setup it in exchange server that we can get local domain sender address information? thanks jack ...

property page
Can anyone point me to some information about using a property page within my project. I want to display data about the MFC document and selected Object to the user so they can view/change them at the same time as looking at the document view. I am using VC++ v6.0 with MFC Any help will be much appreciated Phil >Can anyone point me to some information about using a property page within >my project. Phil, See "Property Sheets and Property Pages" in MSDN. >I want to display data about the MFC document and selected Object to the >user so they can view/change them at...

Custom document properties
I am using Excel 2003. I read in help that I can link content to custom document properties, but on the custom page of the document properties dialog window the checkbox "Link to content" is grayed out! The file is created, saved and opened. How do I gain access to the "Link to content" feature of the custom document properites? You need to create a name next to the formula bar to link to. I've been searching for this for a while and finally figured it out., Read this doc for more info. http://office.microsoft.com/en-us/assistance/HP052036901033.aspx "...

some user have no mail properties in GAL
After a recent move of all my people to the new ex2k server, I have a few users who have no properties when the GAL entry if viewed from a LAN client. The properties are there in ADUC, but if a user tried to select that person from the gal and send a message it is returned saying that the persone doesn't exist in that organization. When I look at the propertied of that person, in the last tab on the left there is no information there. No SMTP, CCMAIL, X.400 , nothing. Most other users have info there but not these few. It seems to be a local LAN problem. internet mail is not affected. Wher...

Project Properties gone blank (Property Pages)
I've just encountered a really weird problem with VS2003. When I pull up the project properties dialog for a project (the dialog that lets you set compiler & linker options) that big white rectangle in the central right which normally lists all the current settings has vanished, leaving a big grey area. There is one exception to this, and that is when I click on the Command Line option under C/C++ or Linker, in which case it displays correctly. I've tried shutting-down the environment and starting fresh, without change, and it does this with any project I load. This is particul...

Help with SORT property in xl2007 and xl2007 !!!!!!!!!!!!!!!!!!!!
I have this line of code in my macro. Someone with Excel 2003 can go past it. BOReportWS.Sort.SortFields.Clear Is there a way to get it to run in xl2003? 'BOReportWS.Sort.SortFields.Add Key:=Range("A3:A" & BO_DownloadWS_lastRow) xl2007 still supports the old syntax. So you could create the macro (record it???) in xl2003 and it'll work ok. This may help (or not!): Dim wks As Worksheet Dim myRng As Range Set wks = Worksheets("Sheet9999") With wks Set myRng = .Range("A3:x" & BO_DownloadWS_lastR...

How do I change the properties of specific points in a scatter plo
....more specifically, I have been creating elevation profiles of state park trails and have been changing the points that coincide with intersections to large circles while leaving the rest of the data series unchanged. Hovering over the line with a pointer until I locate the precise point, and then manually changing it's properties is becoming very time comsuming. Is there a way I can automate the process, or at least do multilple points at once?? If I understand the problem correctly, here is a suggestion: use a second series for the intersections Let's say the distance val...

change property on subform
Hi and thank you for your time, I have a form/subform with a one to many relationship. In the subform, I have fields Oct, Nov, Dec, etc in each record. I want to compare the Nov date to the Oct date and change the BackColor if the dates do not equal. The code works for the current record but the Backcolor will also change in the next record on the many side without making the proper comparison. I have the following code on the On Current property of the subform. Let Nov.BackColor = 123 If Me.Nov.Value > Me.Oct.Value Then Me.Nov.Backcolor = 456 End If So, the Nov Backcolo...

view code & properties
having placed an edit/list box in an excel file i find that i am unabl to alter the properties or view the code when i right click on edit/list box. how can this be achieve -- Message posted from http://www.ExcelForum.com Have you created it from the controls toolbox? If so, select it, right-click on the sheet tab, and select View Code. You should see the properties in the VBE then. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "alexanderd >" <<alexanderd.17f7fh@excelforum-nosp...

Properties
Is there a way in Microsoft outlook if you right click on properties for an appointment that you can see who created the appointment and when it was last edited and by whom? No. You can see the Organizer and last modified time if you use a table view (like all appointments) and add the Organizer and Modified time fields to the view. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlooktips.net EMO - a week...

Keeping Custom Properties When Forwarding or Replying to a Message
We have emails saved on the file system, that is kept track of by another program. These emails have custom properties attached to them. There is no custom form, just custom properties. These fields were originally added using objPost.UserProperties.Add. We need it so that when someone opens up one of these emails through the file system, and then replies or fowards the message, these custom properties are kept in the reply. This is so the external program can track these emails. Is there a way this can be done? We could have these emails opened up using an Outlook command line that i...

Print>Properties>Layout>Pages per sheet: this function/property .
In Excel, when I select multiple pages per sheet and the multiple pages are different sheets, then sometimes my hardcopies do have multiple shrunken sheets printed to one page. Othertimes excel and my printer seem to ignore my "multiple pages to one page" request. Why? I've been having the same problem. If you activate multiple sheets, then tell it to print multiple pages per sheet, Excel only prints the first page in the multiple sheet format (i.e., one small page in the upper left of the page.) The rest of the pages come out full size on separate sheets. Does any...

"Permissions" tab in the mailbox properties
I noticed that I can't see that tab anymore. It just does not appear! I'm using OL2003+Exchange Server 2000 On another PC with OL2000, with the same OL profile, I can see it. ?!?!? thanks k ...

Get the headline in to the document properties.
I have an issue. I have 1300 documents at work and my task is to get the headline to be the title in the documnt properties. I dont have time to do this with every document one by one. Could i make a macro? The text i want as title in the document properties is formatted as "headline 2" THANK YOU / Hanna, Sweden Hi Hanna, You could do it with a macro, but the macro will still have to open, update, save & close each document. This also has implications if the dates on which files were last saved/modified are important. -- Cheers macropod [Microsoft MVP - Wor...

Properties
In the properties menu (when you right click the desktop) under the appearance tab, there is an option for how you want your windows and buttons. For some reason I can only make mine classic. I don't want classic, I want the Windows XP view. How do I get it to work? "JayB56" <JayB56@discussions.microsoft.com> wrote in message news:9FC120B4-9751-4AFB-8070-D34E64FDDFA2@microsoft.com... > In the properties menu (when you right click the desktop) under the > appearance tab, there is an option for how you want your windows and > buttons. > For some ...

Transaction properties
This feels like a dumb question, but I can't find the answer anywhere in help or online. What are the transaction properties for? For example, go to "Banking / Account Tools / View / Properties" to see a (in my case blank) list of properties that can be assigned to a transaction. Is it for managing multiple real estate properties? How is it different from a category? Thanks. -Robert In microsoft.public.money, Robert wrote: > >This feels like a dumb question, but I can't find the answer anywhere in >help or online. > >What are the transaction p...

properties
Hi Visio 2003 SP2 Using flowcharts/ cross functional metric I am trying to replace the propoerties of some shapes with the ones I want to use. In the custom property sets icon I select the buttton "remove existing property sets" and select a shapre and press apply. It does not remove the existing properties in the icon it adds the new ones to the end. Any help approeciated -- Bruce Kirkby Hi Bruce, I'm guessing that the shapes you are using have properties that aren't part of a property set. Sounds a bit silly, now that you've pointed it out... I guess you'd ...

No properties
After a power outage I am unable to bring up the properties of a mailbox in a different site. I receive "The network path cannot be found". I am able to bring up that server in Ex5.5 admin and see the Admin structure. Interesting when I clik ok at the error message the properties box comes up but the General tab is balnk and all other tabs are filled in. Thx -Rp- check your wins server >-----Original Message----- >After a power outage I am unable to bring up the >properties of a mailbox in a different site. I >receive "The network path cannot be found&q...

"Enter Key" enabling on Property Page after editing a List View item
Hi, I have a List View on a Property Page (with a CANCEL button only). I am able to EDIT the List View items by using the BeginLabelEdit event & The EndLabelEdit event. But, after editing the item on the List View, I want the user to press ENTER key (normal behavior) so that he does not have to click elsewhere with the mouse to complete the editing. But, the problem with the Property Page is that after hitting the ENTER key, it dismisses the dialog. So, the ENTER message have been nullified in the PreTranslateMessage(...) function. So, how do I achieve 1. The enabling of the "ENTER&...

How to add property pages to property sheet dynamically.
Hi Frineds, I am supposed to create property pages dynamically and add them to property sheet. Can anybodey help me ?? CPropertySheet::AddPage? joe On Thu, 25 Sep 2008 02:53:23 -0700 (PDT), neeru <neeraj.allen@gmail.com> wrote: >Hi Frineds, >I am supposed to create property pages dynamically and add them to >property sheet. >Can anybodey help me ?? Joseph M. Newcomer [MVP] email: newcomer@flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm I think that dynamically is the only way to add them (at least I don't know of another w...

Join Properties
I've got a query that is linking 2 tables. However, I'm having problems with the join properties in linking these tables. Basically from what I can understand, there are 3 options: 1. Where join field from both tables are equal 2. All records from table 1 and only those from table 2 where they match 3. All records from table 2 and only those from table 1 where they match How do I go about having all records from both tables showing? The tables are as follows: Table 1 Field 1: Department Field 2: Actual Numbers Field 3: Actual Income Table 2: Field 1: Departmen...