OptionGroup & CheckBoxes to return text

G

Guest

Is it possible, or does anybody know a good way of, getting OptionGroups or
CheckBoxes to return text values? For example, a CheckBox returns 'Y' or 'N'
or an OptionGroup could return 'A','X','S','N' etc. Essentially, I want the
data that is stored to be more meaningful to the user when they run queries.
NB for various reasons the users don't use Access Queries but a Form that
allows them to build a query and returns the results in a data grid from
which they can run various analyses or export the data to Excel.
Thanks in advance...
 
B

Brendan Reynolds

See the Access Web article "Return Strings From Option Groups" at the
following URL ...

http://www.mvps.org/access/forms/frm0006.htm

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
G

Guest

Thanks Brendan, however, I want the OptionGroup and CheckBox controls to be
able to display and update data in the underlying table.

A way I have attempted to do this is to create a class that will identify
the (unbound) control and its corresponding field and has a method of
'mapping' the table value to the control value and v.v. Then as data on a
form is saved or loaded various I build and execute SQL Select and Update
queries to get/store the relevant data. This is OK on single record forms
but I also use multi-record sub-forms. I don't think this will work in this
instance because of the way unbound controls work in the Detail section of a
multi-record form.
 
B

Brendan Reynolds

Well, option groups return numeric values. There are various ways you can
translate those numeric values into text in code or using expressions in
queries, but if the desired result is to store text in the underlying table,
why use an option group at all? Why not use a combo box?

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
G

Guest

I guess that's an option its just that when there is a max. of 4 or 5 options
I think an option group is neater and easier to use for data input. I am
experimenting at the moment with using a VBA function as the control source
and the mouse_down event to generate code to update the field - t seems to
work OK for CheckBoxes but not for OptionGroups as the moment! I just
wondered if there wa a tried and tested way of doing it so Ididn't have to
re-invent the wheel!!
 

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