You've to use AddListItem.
myList.AddListItem(cField1)
myList.AddListItem( cField2, myList.NewItemID, 2 )
>Hi,
>
>I am trying to add items to an existing two column VFP list using the AddItem() method. I scan thru a set of records using:
>
>myList.ADDITEM(cField1, , 1)
>myList.ADDITEM(cField1, , 2)
>
>and VFP gives an error ("Not a numeric expression") that I know is due to the missing second parameter to the ADDITEM() method. What I don't understand is that the documentation says,
>
>
Syntax
>
>Control.AddItem(cItem [, nIndex] [, nColumn])
>
>nIndex
>
>...If you omit nIndex and the Sorted property is set to false (.F.), cItem is added to the end of the list portion of the ComboBox or ListBox control.>
>How do I "omit nIndex"? I tried 0 but it doesn't work either! What I really want is for my list to work
exactly as it says in the part of the help shown above. I have the Sorted property set to false and I want the items to be added to the end of the list.
>
>TIA
>
>Mike
--sb--