Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to do gender selection

Status
Not open for further replies.

spencern

Programmer
Dec 20, 2001
78
0
0
US
Hello,
I'm making a form that stores some information about people including gender into a table. I'm not quite sure how I should make the selection of gender on the form though. If I use an option group then it will only store numbers in the table, and I don't really want to use a combo box because it makes it a little more difficult to select.
What does everyone else do for something like this? If I use an option group and it stores the numbers in the table, how could I change that back into male/female on reports and other screens?

Thanks for your help,
Spencer
 
If you use an option group, and ensure that say, 0 = Male and 1 = Female, create a lookup table tblGender with a key field long integer and description.
Enter 0 or 1 in the key field and description in the name.
You can then do a join to this in a query and pull in the appropriate description.

Alternatively you could use a boolean field and have a tickbox on the form (ie tick for male) assume female otherwise, and use an
=Iif(Gender=True,"Male","Female") on reports.
You must set a default value of 0 in this case otherwise Nulls will cause problems.

John
 
This is how i do it. You can make an id field if you want, but it's so simple it's hardly worth it. Just make this as a look up table in a field for you employees table or customers or whatever.
tblcourtesyTitle
cloumns
title gender
mr male
dr male
dr female
sr male
jr male
mrs female
ms female



Mark P.

Bleh
 
Mark
Granted yours works most of the time, but how do you tell if a Dr is male or female from your method?
Also what about surgeons? Female surgeons call themselves "Mr" which totally confuses your system.

John
 
If i use this in a data entry form I use a combo box that shows both colums: gender and title. You can tell a dr is of any gender (including hermaphrodite) by various methods of information display after you have selected Dr. Male or Dr. Female from the combo box.

I've never heard of female suregeons calling themselves Mr. But i'm not saying they don't. Anyways,it doesn't confuse my system(but it does confuse me), because you can add a record with Title of Mr. and Gender of Female. If everyone knows you must be talking about a doctor when you have a reference like that, then you should be fine.

Usually i don't care about gender unless I'm running a query or report that just pulls the gender.

I use this system with Medical Billing, and it's worked for about 2 years.



Mark P.

Bleh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top