Combo Boxes

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

Guest

I want my combo box to list the following selections:

Excellent
Good
Average
Fair
Poor

But when the user chooses one of those selections, I want it to display as 1
for excellent, 2 for good, etc. This is so what we can later average the
numbers and determine that the rating for this particular product was 2.4 or
whatever. Is it possible to do this?
 
What you request is pretty standard setup for a combo box.

You should have a table with two fields to hold your numbers and the
corresponding words:
tblRatings
RatingID Long Integer (primary key)
RatingName Text

Put in this table your data (first record would be 1 for RatingID and
Excellent for RatingName, etc.).

Then use a query for the combo box's Row Source:
SELECT * FROM tblRatings ORDER BY RatingID;

Then set these properties of the combo box:
Column Count 2
Column Widths 0"; 1.5"
Bound Column 1

Now the dropdown list will show the names, allowing the user to select the
value. And that name will show in the combo box after it's selected. But the
real value of the combo box (what your form thinks it is) will be the
RatingID value...that is, 1 if the user selects Excellent, etc.

If you're doing data entry, bind the combo box to the appropriate field in
the form's RecordSource so that the number is stored in the table, not the
name. Then you can run queries later on to calculate your averages.
 
just type it in Row Source of the combo box
"1 Excellent","2 Good","3 Average","4 Fair","5 Poor"

I recomand to create table to make easy for you to rating and so on.
 
Back
Top