Option Group to Char Field problem

K

Kendell

Hi -
I am very new and trying to do something that should be relatively
simple.
I have a 1 Char field in an Access database table. And, I'm
creating a form
and would like to use an Option Group, Option Select Box combination
to select
Male, or Female (ie M and F in the database) However, the only
values it will recognize and assign to the field are 1 and 2, or some
other number.

What am I missing here? How do I accomplish something so simple.
Seems to work fine when I make it a Combo Box -- But, I'd rather use
an Option Group/Option Select.

Thank you so much in advance.

--Kendell
 
F

Fredg

Kendall,
Actually, the Option Group is working quite well.
An Option Groups value is a number, not text.
If you want to use an option group (and I don't know why you would, since
with only 2 options available a simple Yes/No check box would do just as
well), store the value, (1 or 2), in your table.
Whenever you need to read the value you can just use an unbound control with
a control source set to:
=IIf([OptionGroupName] = 1,"M","F")

There are other functions that will also give a text reading, but this seems
the simplest.

If you used a check box instead, all you would need to show text is to use a
text control on your report, etc., (instead of the check box), and set it's
control source to the check box field.
Then, in the control's Format property write:
;"M";"F"
 
C

Chuck Cain

You could use an unbound option group and its AfterUpdate event to
write a value to the field, but why complicate things? Just use a
list box: it's essentially the same thing.

Chuck
 

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

Top