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
616 Views

Similar Articles

[PageSpeed] 49

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:

Visible by code
I have a form called sfrm_status_of_lif_notes. In this form there is a text box called status. This text box is bound to a previous form. In the Detail of the form I have a text box called approved_dt. I have the visibility set to No. I would like approved_dt only to be visible if the status is "Approved" I tried this in the On Open event of the form: Dim blnVisible As Boolean blnVisible = (Me.status = Approved) Me.approved_dt.Visible = blnVisible It did not work. Does anyone have any suggestions? -- Message posted via AccessMonster.com http://www.accessmonster.com/...

Excel Automation problem
hello, I have a problem in my MFC class library (VS2003) w.r.t excel automation. I open an excel file to grab some data and close it. When the user clicks the button to open another excel file, the file that I previously used is show in an excel window that opens... (i NEVER want excel to be visible) My interface to the excel automation is implimented through a singleton object. I think that the focus of excel (even though the visible property is FALSE) is being propagated to the top when focus is lost on my app (focus going to the open dialog). Trying to set breakpoints i can se...

only visible if...
Hi All, I'm self-teaching on Access as I develop a client tracking database for my facility. I'm probably going to say this wrong, but here goes. I have a report where I only want to have a particular field (control?) visible if the data in the field it is boud to says a specific thing. The control is in the Detail section of the report, and it's called Discharge Reason" It refers to a field with the same name in the query the report is bound to. There are 8 possible entries for this field, plus "Contract Change" That's the only one I want to see in my repo...

>> Visible and not visible
Hi, using Access 2003. I have 2 groups of controls on a form. Based upon user selection either one or both groups of controls may be visible. Layout options are 1. one group next to the other group. Visually it looks strange if only the right side group are visible (ok when only left side group visible). 2. one group below the other group. Visually it looks strange if only one group are visible (ok when both groups visible). Is there a way to close the gap when only one group of controls are visible? Any ideas or suggestions appreciated :-) Many thanks, Jonathan Johathan, you can wri...

Text in cell is not visible! 8(
My cell is formatted to accept string type data. However, if the text length is bigger than the cell length then all I see are a bunch of "##################" characters in the cell. Can't Excel just show the text that fits in the cell and possibly clip off the text that extends beyond the cell??? How can I do this? thank u! Try changing the format to General. Excel has trouble strings between 256 and 1024 characters in cells formatted as Text. Robert Crandal wrote: > > My cell is formatted to accept string type data. However, if > the text ...

Printer fonts not visible
Hi I did a report a while ago set to Epson LQ-1050 and using the hardware fonts to speed up printing. Recently I had to make some changes to report but the problem is that the hardware printer fonts do not display in the fonts drop down in report designer even though I select the Epson LQ-1050 printer. What is the problem and how can I fix it? Thanks Regards ...

Store Operation 2.0 In Item Property showing On Order 6 or so.Need
I my Store Operation 2.0 database in am showing some #s in on order. I alreddy all PO closed and I don't have any any back order and its still showing On Order Quantity (Different #s for different items) How do I make this On Order Quantity Zero "0" I am looking for SQL query Update Items Set OnOrder = 0 some thing like that but I dont know the Database field name for Onorder Please help me. ...

.visible = not .visible
I'm getting the following error: "The expression On Timer you entered as the event property setting produced the following error: A problem occured while MSA was communicating with the OLE server or ActiveX Control. The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]. There may have been an error evaluating the function, event, or macro." The event procedure is as follows: Private Sub Form_Timer() lblRememberInfo.Visible = Not lblRememberInfo.Visible End Sub And the Timer Interval is set to 500. I have the sa...

SeriesCollection Values Property Oddity
This has long perplexed me. Thought I would ask someone. The Values property of a series apparently returns an array of all the point values in the series. Howver, one apparently can't extract an element from this array. The following macros demo the issue. Looking for enlightenment: 'This works Sub Test1() Dim i As Long With ActiveSheet.ChartObjects(1).Chart.SeriesCollection(1) For i = 1 To .Points.Count MsgBox Application.Index(.Values, i) Next End With End Sub 'This also works Sub Test2() Dim arr As Variant Dim i As Long With ActiveSheet.ChartObjects(1).Char...

Smart List Favorite add Visible to Organizational Levels
It would be nice if when saving a smart list you could save it to a specific organizational entity. Right now you can pick: System, Company, User Class, User ID. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/New...

How do I disable "Plot visible cells only" when it is greyed out?
I'm creating a chart from a pivot table that has some "zero" values. The chart will not plot the values that have a zero "y value" along the x-axis and I need to see these. I assume I need to disable "Plot visible cells only." If I Select chart then Tools > Options > Chart, the "Plot visible cells only" field is grayed out. How can I get this field so I can change it? Click on the graph first then go to tools, Options, Charts "L. Klein" wrote: > I'm creating a chart from a pivot table that has some "zero"...

custom method not visible...
Hi, I am adding a custom method to active X MFC control using MSVC ++ .net However, in Active X test container , the method is not visible... suggest thanks,, a.a.cpp ...

Excel 2003 Chart Labels Not Visible
Helpful people, I have some charts with 15 data points. Most are very small percent values, say between 1% and 2%. But a few are at 100%. So my chart scale goes from MIN=1% to MAX = 2%. The bars for the 100% guys stretch all the way to the top. My data label positioning (Format>Labels) is "Outside end alligned". In Version 2000 *all* labels show. In Version 2003 the 100% labels have disappeared. This is my problem. I can make them reappear by selecting *all* the labels and changing the label positioning (say, to "bottom"). Then, I could move them all back to the top p...

Properties for Form-based appl
Hello: I created form-based appl with SDI but I cannot change any property for dialog by using dialog properties box. thank you, dave > I created form-based appl with SDI > > but I cannot change any property for dialog by using > > dialog properties box. What do you mean by "form-based appl with SDI" - an SDI app with a CFormView? If yes, you should be able to change the properies of the associated dialog resource template in the resource editor, just like with resource templates which are used for dialog boxes. Which of the properties are y...

average only visible cells?
is there a way to average only visible cells in a list? i am using an advanced filter and wan to automate the averages of columns following the filter. however, i run in to issues of hidden rows being counted in the average when i try to create the formula. is there a function for "visible cells". i know you can go to edit->go to-> visible cells to copy the cells, but i dont want to copy the cells to another sheet and then take the averages there. thoughts? ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post ...

Visible = True
Help please A2002 I am trying to make a label visible based on whether or not a field is populated. The table is called products and the field is called notes. Each product in the table has unique id and not all the note fields are populated I can only get the label to be visible for every product The Fields are ProductId ProductName Status Weight DateAdded Notes On the product form the notes may indicate for example packaging information - the indicator label is show that there are notes to access if needed Many thanks in advance for any help Paul Questions: -- Are you trying t...

Keep my A column visible
Hi, I am trying to keep the A column visible while i scroll right throug the columns. I need to be able to see column A. I have tried freeze bu having some difficulties getting it to work properly. Thanks Crai -- Message posted from http://www.ExcelForum.com Click/Drag small bar bottom of screen (it is in line with sheet tabs fa right between scroll arrow and grey box). Window/Freeze Panes -- Message posted from http://www.ExcelForum.com Put your cursor in B1 and select the cell, go to Windows, Freeze panes "webbynet >" <<webbynet.18nuv9@excelforum-nospam.com>...

Is there a flag in the Property Pages ?
I recently wrote an MFC regular DLL using VC++ 7.0 and Win2000. The DLL seems to work flawlessly on Win 2000 & XP professional, but I also want the same DLL to work flawlessly on Win 98 and Win ME. I have tested this DLL on an app running on Win 98 with no effect. The DLL just sits there. Is there a flag in the Property Pages that will generate a useable DLL for my Win 98 and Win ME system ? The Win9x/Me systems will require the complete set of VC++ 7.0 runtimes. After that, there may be incompatibilities I'm not aware of, but I stopped supporting MS-DOS two years ago. joe On...

Visible or Not
I'm using the following code to make a few objects visible or not. I have it on a report on the Open Event. I get an error "You entered an expression that has no value" Please help? Thanks! If Me.Client_Id = "NA" Then Me.Text32.Visible = False Else Me.Text32.Visible = True Try moving the code to the section that contains the control you are trying to hide. The Open Event is too early. John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County rml wrote: > I'm using the following code to...

Sub Form Not Visible
I have a form with a sub-form enbedded withit. It's a one-to-many relationship. When I click the view button I see the details. This is ok. But when I click the design button, all I see is a white screen with the name of the table that it's linked to. I want to ses the design details. What do I do to make the details of the sub-form visible? ed Ed, This happens when you go to designview from the main form. If you doubleclick the white subform you should be able to see the subform details. You can also close the mainform and then open the mainform in designview straight awa...

Sequential numbering for visible cells
All, I am using one data base wherin I have to hide specific rows and then number the visible rows in sequence i.e.1,2,3,4,... till end of data. Would appreeciate if help can be extended. Ciao Sanjeev Kaura -- skaura ------------------------------------------------------------------------ skaura's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=25455 View this thread: http://www.excelforum.com/showthread.php?threadid=389003 Skaura, In your numbering column, use a formula like =SUBTOTAL(2,$A$2:A2) and copy down to match your table. When the filter is app...

RecordsAffected property
Hi, I need help understanding how the RecordsAffected property woks. I am using the recordsaffected property to capture the number of records inserted into a table. the code is pretty simple RQDb.Execute sql, dbFailOnError lngCount = RQDb.RecordsAffected However it is not working it returns 1 even when it fails to insert the record due to a key violation and should return 0. why? If I run the query manually I get two messages 1) You're about to append 1 row(s) the I click on yes and I get the other message 2) Microsoft Access cannot append all the records in the append...

What are "Properties"?
In the transaction forms, there are two fields labeled "Properties". What are they supposed to be used for? If I don't use them, is there a way to get rid of them? I've searched Help and the on-line User Guide but find nothing about them. (I'm using Money Plus Premium but I think this originated with a prior verision. ) -- -- Weird Harold In microsoft.public.money, Weird Harold wrote: >In the transaction forms, there are two fields labeled "Properties". What are >they supposed to be used for? If I don't use them, is there a way to get rid >...

Form Not Visible
I have a very simple form with two combo boxes & two text boxes that feed selection criteria to a query & then a command button that opens another form based on the query. This form is in the front end of a database that I have installed on multiple users's PCs, some using 2007 & some using 2003. Some users can open the form just fine while others seem to be unable to open the form. However, when I tried to delete the form, I got a message that Access was unable to delete the form while it was open. So it's opening--its just not visible for some users eve...

Cannot display user properties while in the GAL
When I am in the GAL, if i right click any user i get the following error message "The properties dialog box could not be displayed. Microsoft Exchange Server is not configured to support details templates in your language (English). Contact your administrator." Thanks duff If you go into ESM and then to the top tree node, is there an English item in the Detail Templates section? -- -- Brian Desmond Windows Server MVP desmondb@payton.cps.k12.il.us Http://www.briandesmond.com "Duffy" <Duffy@discussions.microsoft.com> wrote in message news:FA62877E-0963-4F3F...