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

copy custom field info from task usage to resource usage view

Status
Not open for further replies.

ptdbc123

Programmer
Apr 30, 2005
4
0
0
US
I recognize that the custom fields defined under the task usage view are not the same as the ones under the resource usage view. What I'd like to know is how to either link the two or copy the information from one view to another in an automated fashion. Any help would be appreciated.
 
Well, first of all, you have to realize that this only works when there is a 1-1 correspondence.

Let's assume you want to copy task field Number1 to resource field Number1.

If a resource is on 5 tasks,
(a) you will copy Task(1).Number1 to Resource(1).Number1
(b) you will copy Task(2).Number1 to Resource(1).Number1 and overwrite what was already there
(c) you will copy Task(3).Number1 to Resource(1).Number1 and again overwrite what was already there
... and so on.

If you copy from Resource.Number1 to Task.Number1 then what will you do if there are multiple resources assigned to a single task because you're going to end up with the same issue but going the other way.

Here's some vba to help get you started.

Dim tTask As Task
Dim rRes As Resource
Dim aAsgn As Assignment
Dim iTask As Integer
Dim iRes As Integer
Dim iAsgn As Integer



For Each tTask In ActiveProject.Tasks
For iRes = 1 To ActiveProject.Resources.Count
For iAsgn = 1 To ActiveProject.Resources(iRes).Assignments.Count
If ActiveProject.Resources(iRes).Assignments(iAsgn).TaskID = tTask.ID Then
tTask.Text2 = ActiveProject.Resources(iRes).Text1
End If
Next
Next
Next
 
I appreciate you taking the time to reply and offer some starting code, but if I understood you correctly I'm going to overlay what I've got. Let me be more specific about what I'd like to do.
I've got numerous tasks associated with a number of resources. One task is assigned to only one resource. I want to be able to capture additional information about the task, including a status that is specific to the company I'm doing this for. If I add that information out to the task view I want it to be displayed in the resource usage view as well. I hope this clarifies.
 
You understood correctly.

But if it's only one task and one resource then why not simply copy&paste?

(I've *got* to be missing something here.)
 
Don't know why I didn't suggest this at the same time.

1. View | Gantt
2. Window | Split
3. Single click in the bottom half of the screen
4. View | Resource Usage.

In the top and bottom half, insert into the display the columns of data that you are interested in.

Now you can easily select the tasks you want and see the appropriate information in the two halves of the display.

If that isn't quite what you want then you can vary the top and bottom displays (Perhaps View | Task Usage in the top and View | Resource Usage in the bottom).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top