Setting values for comboboxes for calculations.

Pis7ftw

Registered User.
Local time
Today, 00:56
Joined
Aug 5, 2012
Messages
37
Me again! Before you ask, I've been reading VBA, VB, Access2010 manuals etc before I post here.

I've run into another snag.

I have multiple comboboxes on a form with yes, no, not applicable selections. On the referring table they are "text" field types. Once completed it becomes a record in it's referring table.

I want to set a value for each selection. Yes = 1, No = -1, N/A = 0 (if this is possible).

The reason for this is I want to calculate how many yes's and how many no's and n/a's and give a percentage based on how many reports.

Example:

Field 1 (Do you have an apple) Yes(4times) out of 20 records. (20%)
No (12 times) out of 20 records. (60%)
n/a (4 times out of 20 records. (20%)

Field 2 (Do you have an orange....etc etc.

Does this make sense or am I just making things more complicated than they should be?
 
If you have your Combo Using a Table as a Row Source that is set up like;

Code:
AnswerID  | Answer
----------|--------
    1     |  Yes
    -1    |    No
    0     |   N/A

Bind the AnswerID Field to your table and you should have no problem. You Could also do this with an Option Group.
 
I'm not sure I follow entirely but I did notice a problem. All my combobox fields are set as text in the table. I should change that to lookup no?

As for AnswerID/Answer I see the correlation but I"m not sure how to implement that into VBA.
 

Users who are viewing this thread

Back
Top Bottom