Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set ms-access combo box selected index

In my MS Access project I need to set selected index of a combobox using VBA. I used the syntax below to select the first item.

Application.CommandBars("MainMenu").Controls("Country").SelectedValue = "US"

After use the above syntax I get the error ”Object does not support this property or method”

enter image description here

I need help to setting the combo box selected item

like image 790
shamim Avatar asked Oct 27 '25 10:10

shamim


1 Answers

 Me.fromDate = Me.fromDate.ItemData(0)    'Get first item and set that to the selected value
    
 Me.toDate = Me.toDate.ItemData(Me.toDate.ListCount - 1) 'Get last item and set that to the selected value
like image 105
mahmoud Avatar answered Oct 30 '25 01:10

mahmoud