Associating tasks with resources

J

jmeade

I need to create a macro that calculates the total cost of a series o
tasks for an MS Project file. The existing cost report is not flexibl
enough.

I am using a form to enter a range of task IDs for the project.
created a for-loop that cycles through each task. However, I can no
figure out how a task and it's properties tie together with resource
and their properties (name, hourly rate, etc.). Does this work simila
to a join in SQL where unique IDs link one table to another?

I can't seem to figure this out. Any help would be appreciated
 
J

John

jmeade said:
I need to create a macro that calculates the total cost of a series of
tasks for an MS Project file. The existing cost report is not flexible
enough.

I am using a form to enter a range of task IDs for the project. I
created a for-loop that cycles through each task. However, I can not
figure out how a task and it's properties tie together with resources
and their properties (name, hourly rate, etc.). Does this work similar
to a join in SQL where unique IDs link one table to another?

I can't seem to figure this out. Any help would be appreciated.

jmeade,
First of all you have posted to a newsgroup that is destined to be
closed. For current active newsgroups on Project, go to our MVP website
at: http://www.mvps.org/project/faqs.htm
and read FAQ 24 - Project newsgroups

With regard to your question. Project's database consists of three
parts, task objects and their properties, resource objects and their
properties and assignment objects and their properties. Assignment
objects basically provide the bridge between tasks and resources.

Individual object properties may be similar or totally unique. For
example, the Name property exists for both a task object and a resource
object. The hourly rate (Standard Rate) property is for resources only.
And as I recall, (I don't have Project open at the moment), Unique ID is
a property task object only, but don't quote me on that. As such the
Unique ID property would NOT be useful for what you want to do.

However you mentioned that you want to create a total cost grouping for
selected tasks. It may well be that you don't need VBA at all. I would
first try using Project's grouping feature (Project/Group by) or perhaps
a formula in a custom field. But, if neither of those will work, tell us
more about your end goal, and then maybe we can help.

John
Project MVP
 
J

Jan De Messemaeker

Hi,

To complement John's answer - and to reply more directly to your question,
supposing you have a task object (call it Otask) then if you lookup the
properties oiof the task object you will find two (collection) properties
that may help you:

Otask.Resources and
Otask.Assignments

Depending on what you want you may need either.
If you want for instance the cost rate of one of the resources it's the
first one you will need; if it's the work the resource does on that task (to
be precise, on the assignment) you need the latter.

Don't think in terms of tables - it's all about objects.

HTH
 

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