How do I bind data to a ComboBox?

Dynamic userform combobox formatting

  • I have userform that contains a combobox. The same userform is called multiple times to allow the user to enter data. I use: With Userform .cboExCombo.additem = end with to populate the drop down list. In some cases I want the user to be limited to selections from the drop-down list and in other cases I want the user to be able to add an entry not included in the drop down list but using a defined format. In different cases the new entry needs to be in a specified format - text, percentage, date. Is there a way to set the combobox format and/or require the user to use a specific format when entering new values?

  • Answer:

    Steve, > Is there a way to set the combobox format and/or require the user to use a specific format when entering new values? there is no built in mask setting or format setting. If the user is allowed to type into the textbox part of the combobox, they can type in anything. What you do have are the change events, Keyup, Keydown exit and so forth events which you can place code in to control what the user can do. So to summarize, you have to write the code and put it in the appropriate event to manage the users entries. There are no properties or settings to provide these capabilities.

Miningco.com Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.