MSProject:Problem Accessing Custom Outline LookUp table

G

Guest

Hi,
MSP2k: I'm trying access the custom outline code1 look up
table to populate a drop down list using
CustomFieldValueListGetItem()

This fails with a 1004. Here is the code. Can anyone see
what's wrong. It works for all the other custom fields
used for populating drop down lists and only seems to fail
on this one. I took the For/Next loop out to simplify the
example. Thanks for any help you can offer.
Dim lstCnt As Integer
Dim lstVal As String
Dim objItm As Object
Set objItm = cmb_Release
' Add a blank selection
objItm.AddItem ""
objItm.List(0) = ""
'
objItm.List(1) = CustomFieldValueListGetItem
(pjCustomTaskOutlineCode1, pjValueListValue, lstCnt)
Exit Sub
 
J

John

It's a little hard to review code if there are parts missing. You don't
mention where the runtime error occurs. Further, I'm a little confused
by your post. The first paragraph indicates you are trying to populate a
list, yet the "CustomFieldValueListGetItem" method reads values already
in the list. Shouldn't you be using the CustomFieldValueListAdd Method?

John
 
G

Guest

Thanks for your reply. Sorry about missing info. I'm
trying to populate a dropdown list in a VB form with the
values from the OutLineCode lookup table. The error
occurs within/upon return from the function call. Here's
the full code. colKey is equal to the FieldValue, in this
case, pjCustomTaskOutlineCode1.
Dim lstCnt As Integer
' Add a blank selection
objItm.AddItem ""
objItm.List(0, 1) = ""
'
On Error GoTo err_cmb_Build_Custom2Col
For lstCnt = 1 To 100
objItm.AddItem _
CustomFieldValueListGetItem(colKey,
pjValueListValue, lstCnt)
objItm.List(lstCnt, 1) = _
CustomFieldValueListGetItem(colKey,
pjValueListDescription, lstCnt)
Next lstCnt
Exit Sub
err_cmb_Build_Custom2Col:
If Err.Number <> 1004 Then
MsgBox (Err.Number & "-" & Err.Description)
End If
Exit Sub
-----Original Message-----

It's a little hard to review code if there are parts missing. You don't
mention where the runtime error occurs. Further, I'm a little confused
by your post. The first paragraph indicates you are trying to populate a
list, yet the "CustomFieldValueListGetItem" method reads values already
in the list. Shouldn't you be using the
CustomFieldValueListAdd Method?
 
J

John

Sorry if this is a duplicate post, my internet connection is unstable.

It still looks like there are missing parts of the code (i.e. you
mention a function but all I see is what might be part of a function). I
don't see anything obvious, however, are you using VBA or VB? I've only
used VBA and don't know if there are differences in the code structure.
Someone else might have an idea. Nonetheless, have you tired stepping
through the code from the time the function is called and see which line
it doesn't like?

John
 
G

Guest

John, for some reason your last message is not available.
Thanks for trying to reply though.
 

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