Value list manipulation

K

kofikko

hey everyone!
I have created 3 value list for 3 textfields , in the
tasks view.
Can i modify a list of a field ("Live") when a selection
of another field was made?
for example , when the user chosses "finance" in the
field text3 , i want to set a specific list for text4
field?
 
R

Rod Gill

Hi,

In Project 2003 I found: CustomFieldValueListAdd

In your version, try recording a macro of you manually adding and deleting
values and see what you get.

--
For VBA posts, please use the public.project.developer group.
For any version of Project use public.project
For any version of Project Server use public. project.server

Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.projectlearning.com/
 
J

John

Kofikko,
My best qualified answer is "yes" but without writing some code, I don't
have any details at the moment. My approach would be to use VBA to query
the initial selection for Text3 and then assign a specific list to
Text4. If you want I can look into it further and make a recommendation.

I realize this isn't a lot of help, but my experience is that with VBA
anything can be done.
John
 
K

kofiko

Thanks for the answer , john.
I have managed to reach a solution , but it's quite ugly
and not perfect.
i am using the Project_change event , and i build a new
list using select case.The problem is , when i change the
list , it delets also existing values of other tasks.
i managed to by pass that , but only changing the list
option to "allow new entries" , which i don't want....
I am using the "CustomFieldValueList" methods....
Is there another way to query the field (without
project_change)?
thanks for any help
kofiko
 
J

John

Kifiko,
I started looking into the ProjectBeforeTaskChange Event but I ran out
of time before I came up with anything. I would have to spend more time
to come up with a solution, but, a solution does exist. Unfortunately I
can't work on it today but I may have some time this weekend.

John
 
J

John

kofiko,
The problem with trying to use a variable value list is that a custom
setting applies to all tasks for that field, not to just a single task
field. Hence as you discovered, changes to the value list overwrite any
previous values. However, I have come up with at least two solutions.

Method 1 - Set up the custom field value list for Text3. Use either the
Change Event or ProjectBeforeTaskChange Event to trigger a UserForm that
displays the second level list. Use the list value selected by the user
on the UserForm to populate Text4.

Method 2 - Set up the cutom field value list for Text3. Use one of the
change Events to trigger the second level list in Text4 but instead of
populating Text4, apply another change Event to the secondary list to
put the secondary value in a third spare text field. In this case the
variable value list in Text4 is simply a bridge to develop the real
secondary value which appears in the third text field. If Text3 & 4 are
sacred, use the third field as the bridge.

Depending on what you end goal is one solution may work better for you.
My tendency would be to use Method 1 - I believe it is a little more
straighforward.

Hope this helps. I told you there was a solution.
John
 
K

kofiko

thanks for your help , john.
just another quick question:How to i access the
ProjectBeforeTaskChange event?
Do i need to create a new class , and declare a project
withevents var?
Thanks again,
kofiko
 
J

John

kofiko,
I believe the answer is yes but I'm embarrased to say that I haven't
actually tried it yet. However according to the VBA help file, you do
need to create a new class and declare the WithEvents variable. I'm
going to work on it if for no other reason than to simply exand my
knowledge base.

Let me know how it works.

John
 

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