N
N
noytmant2021-03-25 10:25:12
Visual Basic
noytmant, 2021-03-25 10:25:12

How to programmatically change the value of a ComboBox and accept it?

When we launch a form, select something in the list and click on it, it is applied. But this is provided that we did everything manually. How can I do the same using VBA? If you write the following: Then it will simply change the value, but there will be no this "Accept change" effect. And you need to accept them because the subsequent elements of the form change, which depend on the value selected in the combobox
ComboBox1.Value = 4

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
idShura, 2021-03-25
@noytmant

Try this ComboBox1.ListIndex = 3 . The index of the first element is 0, so if you want to select the fourth element in the list, you need to specify 3.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question