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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Task field in Resource view 1

Status
Not open for further replies.

Krusher

IS-IT--Management
Jan 2, 2003
70
US
Does anyone have any helpful hints on using using Task fields in the Resource views? I created a custom text field called "cue" and I would like to filter on this in the resource usage view, but unfortunately, the Task fields are not availabe in the resource views. Is there any way to use interchange these fields? Many thanks in advance!

-K
 
There is an issue when you want to look at Resource fields while in a Task View (and vice versa).

Basically:
(1) any task can have multiple resources so if you look at a task you have to be able to see the resource field (let's say Resource.Rate) multiple times (once for each resource assigned to that task).

(2) any resource can be assigned to multiple tasks so if you look at a resource you have to be able to see the task field (let's say Task.Start) multiple times (once for each task assigned to that resource).

When you're printing, it's not a big problem: just print multiple resource lines for a given task (or multiple task lines for a given resource).

Now ... how do you link the two? Well, that's not such a difficult problem: use the Assignment.

So ... here's some code that will go through each resource and pick up information for each task that the resource is assigned to. (Obviously, to do the opposite, simply invert the code.)

This code goes through each resource and the prints the task name of each task the resource is assigned to.

It's a trivial modification to copy a task fields to a Resource field instead of doing the print.

Dim tt As Task
Dim aa As Assignment
Dim rr As Resource

For Each rr In ActiveProject.Resources
For Each aa In rr.Assignments
Debug.Print rr.Name; " "; aa.TaskID; ActiveProject.Tasks(aa.TaskID).Name
Next
Next
 
PDQBach,
Thank you so much! The code worked perfectly :)

-K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top