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.


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SamBAuthor Commented:
Thanks Dhaest - just what I needed!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.