Retrieving Information from Option Group (Option Buttons)

P

Pam

I have an option group (with option buttons) on a form where the user chooses
a priority (Immediately, Schedule or Review). When I create a report based
on a query on this field (and several others), the report shows the value
assigned to the option button that is selected. "1" for Immediately, "2" for
Schedule, etc.) However, I want the report to print out the actual words,
not the value. I would also like the actual field in the table to show the
word and not the number value, so that when the user looks at the table, they
see "Immediately" or "Schedule" or "Review". How can I accomplish this?
 
A

Allen Browne

Create a little table with fields:
PriorityID Number primary key
PriorityName Text Required, indexed no duplicates.

Enter the 3 records.

Create a query, and use this little table as well as your main one. Include
the PriorityName field in the query output, and you can show it on your
report.

Note that if you have some fields that have no priority (no number is
selected, so the field is null in the table), you need to use an outer join
in the query or you won't get those records in your report. Details in:
The Query Lost My Records! (Nulls)
at:
http://allenbrowne.com/casu-02.html
 
P

Pam

Allen ... Thank you! That worked perfectly. In fact, I had 5 or 6 of these
option groups and had the same problem with all of them. Now, they all work
as I wanted them to. Just one question: I did some experimenting with the
outer join and null fields. The type of JOIN that I chose was: "Include all
records from tblERF_ECO (the main table) and only those records from the
tblPriority (the little table I created) where the joined fields are equal."
Is that correct? It seems to work fine. I created several records with some
null values and they came up in my query when I chose that type of JOIN.
 

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