Giving a numeric value to a combo box selection

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

Guest

I want to give a "point" value to a selections made in a combo box points an
(ie. time in related field is > 5 years, they get "5," for 3-5 years they get
"4") Is there a way to do this? I would like to total the values for each
answer.
 
You can do this by creating a multi-column combobox with one column being the
point value. This column can be hid from the user by making the column width
= 0". Then, you can reference it via something like Me.ComboBox.Column(1).
Change the combobox's Row Source (or create a new one) so that this point
value column is included.
 
I overlooked the fact that you had posted this in the query section. So
assuming you cannot change the form design and want to do this purely via a
query, you can create a calculated field. It would look something like:

Points: IIF([Forms]![FormName]![ComboBox]="> 5 years",5,IIF([Forms]![FormName]
![ComboBox]="3-5 years",4,IIF([Forms]![FormName]![ComboBox]="2 years",3,IIF(
[Forms]![FormName]![ComboBox]="1 year",2,IIF([Forms]![FormName]![ComboBox]="<
1 year",1,0)))))

Then you can create another query that totals/sorts/summarizes the Points.
 
Back
Top