user1986119
user1986119

Reputation: 33

How do I Enable Auto complete option in combo box by programming in VBA?

I am dynamically adding combo box to a form but i am not able to enable its auto-complete option. what property should we use to enable its auto complete option.

I Tried it as

Set DesiredControl = UserForm1.Controls.Add("Forms.Combobox.1", Visible)
DesiredControl.Left = 350
DesiredControl.RowSource = "Interface!xfd2:xfd6"
DesiredControl.Top = 20 * i
DesiredControl.Width = 175
DesiredControl.Height = 19
'DesiredControl.AutoComplete = enable

Thanks in Advance.

Upvotes: 0

Views: 3939

Answers (1)

David Zemens
David Zemens

Reputation: 53623

Review the available properties in the VBE, and you will see some like:

MatchEntry and MatchEntryRequired.

enter image description here

You will want to use:

MatchEntry = 1 'fmMatchEntryComplete

And probably in conjunction with:

MatchEntryRequired = True

Upvotes: 3

Related Questions