Show predecessor name

Discussion in 'Project General' started by Mike M, Apr 26, 2004.

  1. Mike M

    Mike M Guest

    Not certain if I'm asking this right..

    When I am in Gnatt chart view on the entry table I want to add a column to show the Predecessor name (not task ID number). There is no selection for this in the Insert Column dialog. How can I either display that value, or store it in a text field?
     
    Mike M, Apr 26, 2004
    #1
    1. Advertisements

  2. Hi,

    I know this can be done with VBA. I'm not postive but it might be doable
    with an "equation" in a custom text field (i.e. text20).

    Mark

    --
    _________________________________________________________
    Mark Durrenberger, PMP
    Principal, Oak Associates, Inc, www.oakinc.com
    "Advancing the Theory and Practice of Project Management"
    ________________________________________________________

    The nicest thing about NOT planning is that failure
    comes as a complete surprise and is not preceded by
    a period of worry and depression.

    - Sir John Harvey-Jones
    "Mike M" <michael.morey(removethis)@hcahealthcare.com> wrote in message
    news:D...
    > Not certain if I'm asking this right...
    >
    > When I am in Gnatt chart view on the entry table I want to add a column to

    show the Predecessor name (not task ID number). There is no selection for
    this in the Insert Column dialog. How can I either display that value, or
    store it in a text field?
     
    Mark Durrenberger, Apr 26, 2004
    #2
    1. Advertisements

  3. Mike M

    JackD Guest

    Not possible in a custom text field.
    An easy way to see this is to go to the window menu, select split, click in
    the bottom pane to activate it, right click and set it to show predecessors
    and successors.
    Or select the bottom pane and then go to the view menu and find the network
    relationship view.

    -Jack


    "Mark Durrenberger" <> wrote in message
    news:...
    > Hi,
    >
    > I know this can be done with VBA. I'm not postive but it might be doable
    > with an "equation" in a custom text field (i.e. text20).
    >
    > Mark
    >
    > --
    > _________________________________________________________
    > Mark Durrenberger, PMP
    > Principal, Oak Associates, Inc, www.oakinc.com
    > "Advancing the Theory and Practice of Project Management"
    > ________________________________________________________
    >
    > The nicest thing about NOT planning is that failure
    > comes as a complete surprise and is not preceded by
    > a period of worry and depression.
    >
    > - Sir John Harvey-Jones
    > "Mike M" <michael.morey(removethis)@hcahealthcare.com> wrote in message
    > news:D...
    > > Not certain if I'm asking this right...
    > >
    > > When I am in Gnatt chart view on the entry table I want to add a column

    to
    > show the Predecessor name (not task ID number). There is no selection for
    > this in the Insert Column dialog. How can I either display that value, or
    > store it in a text field?
    >
    >
     
    JackD, Apr 26, 2004
    #3
  4. Mike M

    John Guest

    Mike,
    This simple VBA code will put the predecessor task name in the spare
    Text15 field. Be aware though that this code only works on the first
    predecessor of a task. If there is more than one predecessor, the code
    will need to be modified (and Text15 might get rather "full").

    Sub PredName()
    For Each t In ActiveProject.Tasks
    If Not t Is Nothing Then
    If t.Predecessors <> "" Then t.Text15 =
    t.TaskDependencies(1).From.Name
    End If
    Next t
    End Sub

    Hope this helps.
    John
     
    John, Apr 26, 2004
    #4
  5. Mike M

    Mike M Guest

    Thanks for the code snippet. I do need all predecessors, so I wrote the following

    Sub PredName(
    Dim t As Tas
    Dim tdep As TaskDependenc

    For Each t In ActiveProject.Task
    If Not t Is Nothing The
    If t.Predecessors <> "" The
    For Each tdep In t.TaskDependencie
    t.Text15 = t.Text15 & "(" & tdep.From.ID & ") " & tdep.From.Name & "
    Next tde
    End I
    End I
    Next
    End Su

    On milestone tasks it is included as a predecessor to itself and is repeated several times. Is there a task type or some thing else to check? Should I exclude the predecessor if the "from.id" is the same a "t.id"? Why are they showing up in the first place?
     
    Mike M, Apr 26, 2004
    #5
  6. Mike M

    Dominic Moss Guest

    Mike,

    In addition to the advice about creating a split screen view where you can
    show the Gantt Chart and the relevant tasks predecessors and successors I
    favour creating a combination view (View, More Views, New) which includes
    the Gantt Chart in the upper half of the screen and the Relationship Diagram
    in the lower half of the screen. This view provides a useful visual check to
    ensure that you have got predecessors and successors the right way around
    and that there is "contuguity" through your schedule - every single TASK
    (please do not link summary tasks to or from anything unless you want a heap
    of trouble) with the exception of the first and last task should ideally
    have at least one predecessor and one successor (at the same time try to
    keep the number of dependencies to the absolute minimum to avoid chaos
    creeping into your schedule by accident) to ensure a continuous sequence
    through the schedule.

    I was taught network planning techniques years ago and this approach has
    served me well and avoids what I call loose end or orphan tasks - tasks with
    a predecessor but no successor, tasks which put crudely don't matter if they
    don't finish!! - That is the inference of there being no successor. In cases
    where there is no obvious successor I tend to use Milestones at the end of
    each stage. phase or section to mark a definite point in the schedule when
    the relevant package of works can be demonstrated to be complete. Linking
    "Orphan" tasks to milestones should not make such tasks critical in the main
    but will reduce the amount of slack or float available to them so that they
    can only slip a bit before it becomes evident there is a problem.

    --
    Dominic Moss

    www.projectability.co.uk

    Helping people achieve more with Microsoft Project

    Tel +44 8707 303 400
    Fax +44 8707 303 500
    "Mike M" <michael.morey(removethis)@hcahealthcare.com> wrote in message
    news:D...
    > Not certain if I'm asking this right...
    >
    > When I am in Gnatt chart view on the entry table I want to add a column to

    show the Predecessor name (not task ID number). There is no selection for
    this in the Insert Column dialog. How can I either display that value, or
    store it in a text field?
     
    Dominic Moss, Apr 26, 2004
    #6
  7. Mike M

    Mike M Guest

    Re: Show predecessor name (resolved)

    OK, I kept at it and came up with the following. I had to test and truncate if I ran over 255 characters

    Sub PredName(
    Dim t As Tas
    Dim tdep As TaskDependenc
    Dim mytext As Strin

    For Each t In ActiveProject.Task
    If Not t Is Nothing The
    If t.Predecessors <> "" The
    t.Text15 = "
    For Each tdep In t.TaskDependencie
    If Not tdep Is Nothing The
    mytext = "(" & tdep.From.ID & ") " & tdep.From.Name & "
    If t.ID <> tdep.From.ID The
    If Len(t.Text15) < 256 The
    If Len(t.Text15) + Len(mytext) <= 256 The
    t.Text15 = t.Text15 & mytex
    Els
    t.Text15 = t.Text15 & Left(mytext, 255 - Len(t.Text15)
    End I
    End I
    End I
    End I
    Next tde
    End I
    End I
    Next
    End Sub
     
    Mike M, Apr 26, 2004
    #7
  8. Mike M

    Yamini

    Joined:
    Dec 5, 2017
    Messages:
    1
    Likes Received:
    0
    Hi Mike, I have tried the above code snippet but still its looping multiple time even for the task with single predecessor and displaying the name repeatedly. Can you help to resolve this
     
    Yamini, Dec 5, 2017
    #8
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.