nfashaw,
Yes you are right, I didn't realize SelectedItem woud give me what I was looking for.
But still have the e.cancel=true not working problme.
Main Topics
Browse All TopicsI have this combo box (cboCustomer) and it displays a list of Customers. I want to make sure that the user in facts has selected a Customer from this List. So I put this simple line of code behind Validating Even.
But I have two problems:
1. The If is allways False. This Contains method never returns True.
2. e.cancel executes but does not keep the focus to this control
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi Jess31,
The easiest validation for combo boxes is by checking the selected index, when the user write on a combo box value that is not in the list then the selected index will be -1, It is better to do your validation when user press a button or whatever control that you are using. Canceling user inputs when it is not in the list will confuse the user. So your validation must be like attached code.
e.cancel is not affecting combo box editor, so the entered value will be as user wrote.
Good Luck
Business Accounts
Answer for Membership
by: nfashawPosted on 2009-11-04 at 12:20:30ID: 25743499
As far as the IF statement is concerned, how about something like:
m Is Nothing Then
If Me.CboCustomer.SelectedIte