Option groups.... PLEASE HELP!!!!

K

kinlye

I have an option group in a form, two selections male or female. The table
that the information is inserted in (using this form) only shows a 1 or a 2.
How do I get it to also show male or female?
 
R

Rick Brandt

kinlye said:
I have an option group in a form, two selections male or female. The
table that the information is inserted in (using this form) only
shows a 1 or a 2. How do I get it to also show male or female?

You don't. Option Groups only retunr numeric values, but you can easily
display text instead on forms and reports.


=Choose(FieldName,"male","female")
 
K

kinlye

Amateur at work here...
Do What?? :eek:)
If I have this right, my table will always show a 1 or a 2, I can't get it
to show male or female?
The second part of your answer....
you can easily
display text instead on forms and reports.
=Choose(FieldName,"male","female")
On the form it already shows text beside the option as that is what I
labeled them, but on the report associated with this form it shows the number
value associated with the option I selected on the form. I assume that is
where the "formula" above comes in, but where do I put it?
 
S

Sharkbyte

Me and my amateur spelling/typing. =/

Sharkbyte said:
Not the prettiest, but a good ametuer fix would be to create

tblSex
SexID
Sex (PK)

Then create a relationship, or query, to convert the number to the text.

Sharkbyte
 
R

Rick Brandt

kinlye said:
Amateur at work here...
Do What?? :eek:)
If I have this right, my table will always show a 1 or a 2, I can't
get it to show male or female?
The second part of your answer....
you can easily
On the form it already shows text beside the option as that is what I
labeled them, but on the report associated with this form it shows
the number value associated with the option I selected on the form.
I assume that is where the "formula" above comes in, but where do I
put it?

On your Report you would have a TextBox and in its ControlSource you enter
that expression instead of the name of your field. Also make sure the name
of the TextBox is NOT the same as the Field in the expression.

The Chooses function works like this.

=Choose(SomeField,"Return this string when SomeField = 1","Return this
string when SomeField = 2")

It works nicely in your case because you just happen to be storing the
numbers 1 and 2. I believe Choose will work with values as high as 10.
 
S

Sharkbyte

Not the prettiest, but a good ametuer fix would be to create

tblSex
SexID
Sex (PK)

Then create a relationship, or query, to convert the number to the text.

Sharkbyte
 
Top