>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
[quoted text clipped - 5 lines]
>
>=IIf([Project]<>"",[ProjectCounter].[Visible]=Yes,[ProjectCounter].[Visible]=No)
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?
> >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
[quoted text clipped - 13 lines]
>
> Me.ProjectCounter.Visible = (Me.Project <> "")
Marshall Barton - 29 Feb 2008 20:08 GMT
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, "") <> "")

Signature
Marsh
MVP [MS Access]
>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
[quoted text clipped - 18 lines]
>>
>> Me.ProjectCounter.Visible = (Me.Project <> "")