cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the selected item from a combobox ?

Former Member
0 Kudos

Hi all,

Someone can help me in the script below .... there is something wrong and I cannot see what is wrong with.

The error message is: "Run-Time error '13' Type Mismatch"

I'm using SBO 6.05.098 SP:01 EF:14

The Combobox was created via Screen Painter

Thanks,

[script]

Dim wcombo As New SAPbouiCOM.ComboBox

Dim wcheck As New SAPbouiCOM.CheckBox

Dim w_csource As Boolean

Set oForm = SBO_Application.Forms.Item("fmb_custo")

w_datede = oForm.Items("txt_dateto").Specific.Value

w_datede = oForm.Items("txt_datefr").Specific.Value

<b> Set wcombo = oForm.Items.Item("cmb_mes") ' <----- Here the error happens, why ?</b>

wcheck = oForm.Items.Item("chk_update")

w_csource = wcombo.Selected.Value

[/script]

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The error occurs because you are trying to assign an "Item" object to a "Combobox" variable. Try the following:

Set wcombo = oForm.Items("cmb_mes").Specific

Set wcheck = oForm.Items("chk_update").Specific

John.

Answers (0)