how to use LinkedFieldID to display linked field for hammock tasks?

D

Denis

I try to display the name of the task to which the successor task is linked
to to create a hammock task.
Mike Morey wrote the following code to display the "true" predecessor's
name.
Imagine B is a hammock task between A and C. How could this code be modified
to display the name of the "linked predecessor" task A to wich the successor
hammock task B is linked (start of B is linked to end of A) and display the
name of the final task C to which the end of task B is linked too.

Here is Mike's code (which serves its purpose perfectly btw, thx Mike)

Sub PredName()
Dim t As Task
Dim tdep As TaskDependency
Dim mytext As String
Dim Linkedpred As String


For Each t In ActiveProject.Tasks
If Not t Is Nothing Then
If t.Predecessors <> "" Then
t.Text15 = ""
For Each tdep In t.TaskDependencies
If Not tdep Is Nothing Then
mytext = "(" & tdep.From.ID & ") " & tdep.From.Name & " "
If t.ID <> tdep.From.ID Then
If Len(t.Text15) < 256 Then
If Len(t.Text15) + Len(mytext) <= 256 Then
t.Text15 = t.Text15 & mytext
Else
t.Text15 = t.Text15 & Left(mytext, 255 -
Len(t.Text15))
End If
End If
End If
End If
Next tdep
End If
End If
Next t
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top