View Full Version : VBA - Textbox value in form


ProjectUser
06-27-2007, 04:22 PM
Got a text box in a form that needs to display a count value when the form is
opened. The value that needs to show in the textbox is a count value. For
example, the number of tasks with “yes” in a customized field column (Flag1)

I’ve tried several things to no avail. I’m assuming the code should be
written in the Private Sub Userform Initialize() section.

Can someone provide me with some coding ideas ? Also, please let me know if
I’m correct in assuming the code should be placed in Private Sub Userform
Initialize().
Thanks,

Jan De Messemaeker
06-27-2007, 06:43 PM
Hi,

Yes that is the place

Flagcount=0
For each anytask in activeproject.tasks
if not anytask is nothing then
if anytask.flag5 then
flagcount=flagcount+1
end if
end if
next anytask


HTH

--
Jan De Messemaeker
Microsoft Project MVP
http://users.online.be/prom-ade
"ProjectUser" <ProjectUser@discussions.microsoft.com> wrote in message
news:6F349962-B7BB-46C9-B233-D1DF93FF3E0E@microsoft.com...
> Got a text box in a form that needs to display a count value when the form
> is
> opened. The value that needs to show in the textbox is a count value.
> For
> example, the number of tasks with "yes" in a customized field column
> (Flag1)
>
> I've tried several things to no avail. I'm assuming the code should be
> written in the Private Sub Userform Initialize() section.
>
> Can someone provide me with some coding ideas ? Also, please let me know
> if
> I'm correct in assuming the code should be placed in Private Sub Userform
> Initialize().
> Thanks,
>