Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Numerical Combo Values 1

Status
Not open for further replies.

Gojira999

Technical User
Jun 22, 2004
57
0
0
GB
Hi all.

I am building a form with 150 or so combo driven questions, each offering the user a short range of possible answers (yes/no/not app).

I want to apply a numerical value to the answers (yes & na = 1, no=0) so I can score the results later. Is this something I can do in Access or is it a programmatic thing? Help please!

Thanks.
 
It depends on what your RowSource is for each combo box.

If the combo RowType is Table/query then add the relevant number to the underlying table.
and proceed with the "and set the .. .. " bits belw.


If the combo RowType is ValueList then change the Rowsource to

1;Yes;0;No;1;N/A

and set the ColumnCount = 2
and set the ColumnWidth = 0
and set BoundColumn = 1
The first column will then contain the number but will be zero width so the user won't see it.
They will see the text column only.
But because you have bound the ( non visible ) number column the combo box will return the number they have chosen not the text value they see.



'ope-that-'elps.

G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Slight problem.

The "yes" & "no" selection works fine, but if you select "n/a" it reverts to "yes".

Any way around this?
 
Change the data type of the field from YesNo to integer.
Table fields, AFAIK, can't store tristate boolean values.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks. Unfortunateley, the combo is still misbehaving.
 
What are the RowSource, BoundColumn and ControlSource properties of the Combo ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
RowSource is 1;Yes;0;No;1;N/A

BoundColumn is 1

ControlSource is blank
 
Are you aware that Yes and N/A are both = 1 in your RecordSource ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yep, they are both designed to give the same result.
 
So, it's normal behaviour having N/A coming back to Yes ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Normal to return the same value to the db, but I kinda wanted the combo to show them as different selections.

Guess I may have to chalk it up as a "feature"!

Thanks anyway :)
 
How the combo is supposed to make a choice between N/A and Yes when the table value is 1 ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I want the combo to provide a value to the table, not extract one.
 
And in the table you don't care the diff between Yes and N/A ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
No.

It is an audit database so it is primarily interested in what hasn't been done (the zeros). "Yes" and "n/a" signify either a tasks completion or it's irrelevance to the case in question.

This allows me to add the number of questions, per sub catagory, and give a % score.

EG:
10 questions
7 yes or n/a answers=7 points
Therefore 70% score.
 
Why not change the RowSource to 1;Yes;0;No;3;N/A and when calculating the score count the number of 0's rather than summing the field?


Randy
 
How would I count the zeroes in a query (bit thick here sorry!)
 
SELECT Count(FieldName) AS Zeroes FROM TableName WHERE FieldName = 0;


Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top