Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenate custom text fields into one Enterprise text field

Status
Not open for further replies.

cdrivanova

Technical User
Oct 15, 2002
8
US
Hi all,

How can I concantenate X number of text fields into one Enterprise text field?

I know the code to just concatenate 2 fields and populate a third field:

Sub addFields()
Dim t As Task
For Each t In ActiveProject.Tasks
If Not t Is Nothing Then _
t.Text3 = t.Text1 + t.Text2
Next
End Sub

My problem is that I have X number of text fields, i.e., I don't know how many tasks will have this field populated.

Ex: in Project 1, 5 tasks have text1 populated. I want to populate Enterprise Text1 with: Task1.text1 + Task2.text1 + Task3.text1 + Task4.text1 + Task5.text1.

Ex: in Project 2, 2 tasks have text1 populated. For this, I want Enterprise Text1 to be populated with: Task1.text1 + Task2.text1.

So, I need to be able to count how many tasks have Text1 populated, concatenate all those texts fields and put that value into my Enterprise Text field.

Lastly, I want to overwrite Enterprise Text field every time the project is saved, so that the Enterprise Text field only contains current information.

Phew! Not too much to ask, I hope! :)

Thanks for any help you can provide,
Phyl
 
In Project, using field formulas you can only reference the fields in the current task.

Therefore, it logically follows, that your attempt to have Task1.text1 + Task2.text1 + Task3.text1 + Task4.text1 + Task5.text1 is doomed to failure. (Why you would even want to do this is beyond my comprehension.)

I suspect that what you want to do is not what you are asking how to do.

 
Well, actually it's not an unreasonable thing to do. In the text field, we list the software defects that will be resolved in that particular task. Then, we want to compile a complete list of all the defects that are being resolved in the entire project.

It can be done, but you can't get an unlimited number of characters to show in Project Center (we're using MS Project Pro and Project Server 2003). Enterprise Global Text fields are limited to 256 characters, so not all text would be shown.

Thank you for responding,
Phyl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top