Selecting a task in a master project

Y

Yoav

Hi,

I wrote a code which worked in a single project with SelectTaskField:
SelectTaskField Row:=RowID, Column:="Name", RowRelative:=False

When trying to run this code in a master project (a project with
inserts), this code didn't work.

As I can use the following code in a master project: SetTaskField
Field:="Notes", Value:="True", TaskID:=ProjectRowID,
*ProjectName*:=ProjectName,
how can I relate to a specific project name is SelectTaskField in a
master project?
 
J

John

Yoav said:
Yoav ??????:

Yoav,
You probably didn't get an answer sooner because this newsgroup is being
eliminated and therefore is not checked regularly by those of us who
answer posts. In the future, see FAQ 24 - Project Newsgroups, on our MVP
website at: http://www.mvps.org/project/faqs.htm

When using a foreground processing type statement (i.e. one that selects
a field), references to a row is in terms of what is visible on the
screen. For example, if the active view is filtered and you want to
select row 5, the code will select the 5th row in that filtered view,
not ID 5, which may or may not be visible in the filtered view. A
similar thing holds for a master project. For a master project the ID
sequence starts over for each inserted subproject. So for example let's
say you want to select ID 5 of the second inserted subproject. You would
need to count the rows in the visible view to find out which row is ID 5
of that subproject. Not real convenient, right?

There are better methods for selecting a particular field when
foreground processing is used (more on that later). For example, the
Find Method will find and select a particular field - if it exists in
the active view.

In most cases, working directly with Project's objects (background
processing) is faster and much more efficient. With background
processing it doesn't matter which view is active or whether the data is
filtered, sorted, grouped or whatever since the code operates directly
on Project's objects in the underlying Project database. Just for
reference a macro that is recorded will always produce foreground
processed code which macros that are created directly using the VB
editor will normally always execute using background processing.

John
Project MVP
 

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