Posted by: chulbuley February 22, 2011
Login in to Rate this Post:
0
?
I am trying to create a Form in Access Database which has following fields:
Subject_ID
Date
Ethnic_category
Ethnic_Type
Father
Mother
GrandPa
GrandMa
------------------------------
Subject_ID and Date are in main form. Rest of the fields are in sub-form
Father, Mother, GrandPa, and GrandMa are check Box
Ethnic_category and Ethnic_Type are Combo Box with pre-defined values are limited to following:
Ethnic_Category Ethnic_Type
Jewish : Ashkenazi Jewish
Sephardic Jewish
European : Northern European
Central European
Scandinavian
Asian : Chinese
Japanese
Thai
Latino/Hispanic : Mexican
Cuban
---------------------------------------------------
The idea of this form is to be able to store all the information into a single table and since one person's ancestry can have multiple ethnicity, we can't make Subject_ID as a primary key and should be able to store multiple rows for same SubjectID.
For example:
Subject_ID Date Ethnic_category Ethnic_type Father Mother GrandPa GrandMa
1001 1/1/2011 Asian chinese 1 Null 1 1
1001 1/1/2011 European Northern Null 1 Null Null
1002 1/2/2011 Latino Mexican 1 1 1 1
1005 1/5/2011 Asian Thai 1 Null Null Null
1005 1/5/2011 Asian chinese Null 1 Null Null
1005 1/5/2011 Jewish Ashkenazi Null Null 1 Null
1005 1/5/2011 Latino cuban Null Null Null 1
----------------------------------------------------------------------------------------------------------
My problem is :
I was able to input all the values of Ethnic_Category and Ethnic_type in a combo box and it will give user an option to select any of the pre-defined values and will store in the table but i want to control the second combo box (Ethnic_type) based upon the selection of first combo box (Ethnic_category) . For example if a person select "Asian" from the category the ethnic_type list should display only "Chinese" , "Japanese" , and "Thai" and similarly if i change it to Latino/Hispanic category it should display only Mexican and cuban and store the record after the selection is made
I am a rookie when it comes to writing VB scirpts and tried some of the codes from google search but still couldn't control my combo box properly.
I followed this link too but it didn't work: http://office.microsoft.com/en-us/access-help/basing-one-combo-box-on-another-HA001173058.aspx
any help will be greatly appreciated. Thanks
Subject_ID
Date
Ethnic_category
Ethnic_Type
Father
Mother
GrandPa
GrandMa
------------------------------
Subject_ID and Date are in main form. Rest of the fields are in sub-form
Father, Mother, GrandPa, and GrandMa are check Box
Ethnic_category and Ethnic_Type are Combo Box with pre-defined values are limited to following:
Ethnic_Category Ethnic_Type
Jewish : Ashkenazi Jewish
Sephardic Jewish
European : Northern European
Central European
Scandinavian
Asian : Chinese
Japanese
Thai
Latino/Hispanic : Mexican
Cuban
---------------------------------------------------
The idea of this form is to be able to store all the information into a single table and since one person's ancestry can have multiple ethnicity, we can't make Subject_ID as a primary key and should be able to store multiple rows for same SubjectID.
For example:
Subject_ID Date Ethnic_category Ethnic_type Father Mother GrandPa GrandMa
1001 1/1/2011 Asian chinese 1 Null 1 1
1001 1/1/2011 European Northern Null 1 Null Null
1002 1/2/2011 Latino Mexican 1 1 1 1
1005 1/5/2011 Asian Thai 1 Null Null Null
1005 1/5/2011 Asian chinese Null 1 Null Null
1005 1/5/2011 Jewish Ashkenazi Null Null 1 Null
1005 1/5/2011 Latino cuban Null Null Null 1
----------------------------------------------------------------------------------------------------------
My problem is :
I was able to input all the values of Ethnic_Category and Ethnic_type in a combo box and it will give user an option to select any of the pre-defined values and will store in the table but i want to control the second combo box (Ethnic_type) based upon the selection of first combo box (Ethnic_category) . For example if a person select "Asian" from the category the ethnic_type list should display only "Chinese" , "Japanese" , and "Thai" and similarly if i change it to Latino/Hispanic category it should display only Mexican and cuban and store the record after the selection is made
I am a rookie when it comes to writing VB scirpts and tried some of the codes from google search but still couldn't control my combo box properly.
I followed this link too but it didn't work: http://office.microsoft.com/en-us/access-help/basing-one-combo-box-on-another-HA001173058.aspx
any help will be greatly appreciated. Thanks
Last edited: 22-Feb-11 01:36 PM