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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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")
 
Amateur at work here...
Do What?? :o)
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?
 
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
 
kinlye said:
Amateur at work here...
Do What?? :o)
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top