To solve this problem,you need to understand the flow,may be it will help you.
1)For finding the Male or Female according to selection name from combobox.you need to store data relationship in database/structure.(according to your requirement)
Structure Data
2)And check from database or structure where it is Male Or Female on combobox selecction changed evenet.
Thanks.