VBA - Textbox value in form

P

ProjectUser

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,
 
J

Jan De Messemaeker

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
 
Top