• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1433
  • Last Modified:

Restrict / Validate Input into a Databound ComboBox

Hi Experts - I'm sure this must be simple but I'm just missing the solution ....

I have a combobox bound to a column (fTitle) that shows the title for a contact (i.e. Mr / Mrs / Miss etc .....). This combobox uses a seperate datasource table to pick up the available titles. That seems to work fine but I want to restrict the combobox input to only those values in the datasource column. At the moment although the dropdown shows the correct list, it will allow me to overwrite with anything I choose.

The database is MS Access and in the appropriate table fTitle is designed as a lookup field linked to the titles table. In Access this restricts the user to only inputing values from the titles table - but when updated from my VS app it allows me to update to anything.

Your help would be much appreciated.


1 Solution
The DropDownStyle property in the Appearance section of the properties window allows us to set the look of the ComboBox. The default value is set to DropDown which means that the ComboBox displays the Text set by it's Text property in the Textbox and displays it's items in the DropDownListBox below. Setting it to simple makes the ComboBox to be displayed with a TextBox and the list box which doesn't drop down. Setting it to DropDownList makes the ComboBox to make selection only from the drop down list and restricts you from entering any text in the textbox.
SamBAuthor Commented:
Thanks Dhaest - just what I needed!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now