By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,482 Members | 2,073 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,482 IT Pros & Developers. It's quick & easy.

Combo Boxes

P: 1
I would like when a user has chosen Male or female from a combo box to be offered the choices of "mr" for those that select Male and "mrs, miss or mizz" for those that select female. The user would then choose the appropriate one.
Dec 7 '11 #1
Share this Question
Share on Google+
2 Replies


Seth Schrock
Expert 2.5K+
P: 2,931
How I would do it is to create a table (I'll call it tblSaluation) that has the following fields:

ID
Gender
Salutation

The ID field would be auto numbered and your primary key. So your records would look like this:
Expand|Select|Wrap|Line Numbers
  1. ID    Gender     Salutation
  2. 1    Male        Mr.
  3. 2    Female      Mrs.  
etc.

Then in your Gender combo box you can put the following in its row source property :
Expand|Select|Wrap|Line Numbers
  1. "Male";"Female"
Then in your Salutation Combo box, you put the following again in its row source property:
Expand|Select|Wrap|Line Numbers
  1. SELECT Salutation
  2. FROM {Salutation table name} 
  3. WHERE Gender = {Gender combobox name}.
I would then put the following in the gender combo box's AfterUpdate event code:
Expand|Select|Wrap|Line Numbers
  1. Me.{Salutation combo box's name}.requery
That should do you. If you ever want to add a salutation in the future, all you have to do is add it to the salutation table and mark which gender it belongs to and it will be included in the combo box the next time you open the form.
Dec 8 '11 #2

NeoPa
Expert Mod 15k+
P: 31,186
NB. That should be Ms rather than Mizz.
Dec 9 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.