AddListItem Method

Applies To   See Also

Adds a new item to a ComboBox or ListBox control, optionally allowing you to specify the item's item ID.

Syntax

Control.AddListItem(cItem [, nItemID] [, nColumn])

Arguments

cItem

Specifies the item to add to the control.

nItemID

Specifies an integer representing the unique ID of the item in the control. The maximum value you can specify for nItemID is 32,767.

If you omit nItemID and the Sorted property is set to true (.T.), cItem is added in alphabetic sort order. If you omit nItemID and the Sorted property is set to false (.F.), cItem is added to the end of the list of the ComboBox or ListBox.

nColumn

Specifies the column of the control to add the new item to. The default is 1.

Remarks

Use the AddItem method or AddListItem method when the RowSourceType property is set to 0 (None).

Each item added to a ComboBox or ListBox has two identification numbers assigned to it: