ISComboBox.ItemIndex

Description

The index of the selected item of the specified combo box.

Syntax

object.ItemIndex

Part Attribute Type Description
object Required
The object always implements the ISComboBox interface

Return Value

int

Example

Display some information about the specified combo box, including the index of the selected item.

Dim aComboBox
Dim aMessage

Set aComboBox = Form.Controls_("cmbInform")

if aComboBox.ItemIndex < 0 then 
  aMessage = vbNewLine & "No item is selected"
else  
  aMessage = aMessage &_
    "Caption: " & aComboBox.Caption & vbNewLine &_ 
    "Type Name: " & aComboBox.TypeName & vbNewLine &_
    "Item Index: " & aComboBox.ItemIndex & vbNewLine &_
    "Selected Item: " & aComboBox.Items.Strings(aComboBox.ItemIndex)            
end if 
Profile.MsgBox(aMessage)  
Note: This macro should be executed in any event handler of the form control.

In Profile Client v8 on User Interface Item Index can be found in Maintain > Templates > Health Record Collection Templates > Open the selected form template > Open form editor > Object Inspector > Select the combo box in the controls tree > ItemIndex.

Version information

Added in v7.8.0