SelectTaskField

Y

Yoav

Hi.
I'm using Project 2007 Standard.
I tried using SelectTaskField funtion:
SelectTaskField row:=500, Column:="Indicators", RowRelative:=False
The thing is when the view is filtered, the selected task is #500 in the
view, and not task #500.
How do I make the selected task to be task #500?
Thanks,
Yoav
 
J

Jack Dahlgren MVP

Why do you need to select the task?
You can set all of the properties of task 500 by using something like

activeproject.tasks(500).name = "my new name"

or anything similar to that.

-Jack
 
J

John

Yoav said:
Hi.
I'm using Project 2007 Standard.
I tried using SelectTaskField funtion:
SelectTaskField row:=500, Column:="Indicators", RowRelative:=False
The thing is when the view is filtered, the selected task is #500 in the
view, and not task #500.
How do I make the selected task to be task #500?
Thanks,
Yoav

Yoav,
I agree with Jack. There are likely better ways to do what you need than
using the SlectTaskField Method. However, just for your reference, when
any foreground processing method is used, (i.e. a method that works on a
selected object), row references are to the row of the displayed view,
not to the task ID.

John
Project MVP
 
Y

Yoav

John, Jack
Thanks for your answers.
Actually, I'm trying to create a code that changes the view and the filter,
and sets the selected task to a predefined task ID (for example, I've stated
task #500).
I know how to change the view and filter; however I couldn't find the proper
way to select a certain task.
It's important for me to be able to select a curtain task so the user will
not need to scroll down to find it.
Is it possible to control the selected task (note, as mentioned, a filter is
applied to the view)?
 
J

John

Yoav said:
John, Jack
Thanks for your answers.
Actually, I'm trying to create a code that changes the view and the filter,
and sets the selected task to a predefined task ID (for example, I've stated
task #500).
I know how to change the view and filter; however I couldn't find the proper
way to select a certain task.
It's important for me to be able to select a curtain task so the user will
not need to scroll down to find it.
Is it possible to control the selected task (note, as mentioned, a filter is
applied to the view)?

Yoav,
Sorry for the delay in responding, I didn't notice your follow-up until
I looked today (a week later).

Since you are in foreground processing mode when you select a row
probably the best approach is with the FInd method. Specify the ID field
as the field to search and the ID number as the value. However, you will
probably need to handle an error if the ID you are searching for is not
shown in the filtered view. One way to do that is with the "On Error
Resume Next" statement. Just remember to clear the error using the "On
Error GoTo 0" statement after you've handled the find error.

Hope this helps.
John
Project MVP
 
Y

Yoav

Hi, John
That's exactly the solution I was looking for. Thanks!!
By the way, I'm aware of the On Error Resume Next method, but what does On
Error Goto 0 do?
 
M

madhavig gupta

Hi,

If the column name contains spaces, how to access it? e.g. 'Actual Duration'. I tried giving underscore, but its not working.

thank you.
-Madhavi



Jack Dahlgren MVP wrote:

Re: SelectTaskField
24-Nov-08

Why do you need to select the task?
You can set all of the properties of task 500 by using something like

activeproject.tasks(500).name = "my new name"

or anything similar to that.

-Jack


EggHeadCafe - Software Developer Portal of Choice
Generic CAPTCHA Image Form Test
http://www.eggheadcafe.com/tutorial...9-f110e25ecf46/generic-captcha-image-for.aspx
 

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