Assigning Multiple Resources for fixed units and fixed work (Array

N

Nancy

I'm trying to add multiple resources for one task. So if the task is of
fixed duration, I can just copy the untils to a new row. But if it's a fixed
unit or a fixed worked, then how can I add the new resouce to the assument.
I know with the fixed work that I'm needing to count the number of resources
there already are, and then divide that number + the one I'm added as new, by
the total number of hours (summing the hours up for each already assigned
resources). But I'm not sure how to do this in code. Nor do I know how to
do it in code for the fixed units. I'm thinking I need to use an array, but
I'm not sure how to populate that while you're in a for each asn in tsk loop.
Any help would be appreciated.

Thanks,
Nancy
 
C

Chris

Don't know if this little code snippet will help you, but this is what I've
used to assign all resources that were selected in TeamBuilder to a task:

Dim R As Resource
Dim Rs As Resources
Dim t As Task
Dim Ts As Tasks

For Each R In Rs
On Error Resume Next
If Not (R Is Nothing) Then
Ts(t.ID).Assignments.Add ResourceID:=R.ID
End If
Next R


- Chris
 
N

Nancy

Thanks Chris,
My next question is how are the units, duration and hours effected when you
add a new resource? Do they automatically update and calulate correctly?
Such as fixed durations, fixed unit, fixed work.
 
Top