Building a query using selections from a combo box

Derrick_0690

New member
Local time
Yesterday, 22:06
Joined
Sep 19, 2011
Messages
7
Hi everyone.
I have built a combo box into a form that I have. There are three choices in the combo box to choose from. They include “False Positive”, “False Negative”, and “Okay”.
When one of these choices is selected, a field in one of my tables is updated with whatever was picked out of the combo box. My issue is that these three separate choices all get put under a single field (column) once selected.
I need to be able to “count” how many “False Positives”, “False Negatives”, and “Okays” that I have per DMS ID.
How do you count different entries under a single field in a table?
I have zero programming background. I know how to use wizards and the expression builder and that’s it.
I tried adding the “Rev Stat” field to the query 3 times. For the first instance I used the criteria “Like False Positive”. The second instance I used “Like False Negative” and the third instance I used “Like Okay”. However this did not work at all.
Any help that you guys can give would be greatly appreciated!
 
"Like" means what it says, it's vague. just "False Positive" as criteria would filter the recordset. An example would be Like "False*" which would return all records which start with false (both false pos & false neg).

One way would be 3 calculated fields like this example:

Code:
FN: Iif([FieldName]="False Negative",1,0)

This would give you 3 columns and each record should have one of them populated with 1 and the other two populated with 0.

These could then be summed in report footers, or another query based on that could use aggrigate functions (like Sum) to provide you with the totals from this query.
 
Create a query that includes your DMS ID field (plus whatever other fields you need other than the Rev Stat field). Add the Rev Stat field to the query three times (you were kind of on the right track with that before), then modify those three instances of the Rev Stat field so that they read like the following in the field row;

1) FPCount: IIf([Rev Stat]="False Positive",1,0)
2) FNCount: IIf([Rev Stat]="False Negative",1,0)
3) OKCount: IIf([Rev Stat]="Okay",1,0)

Change it to a Totals query (View Menu - Totals). Use Group By (in the Total row of the query design grid) on the DMS ID field (and whatever other fields you added) and use Sum on the three Rev Stat fields.
 

Users who are viewing this thread

Back
Top Bottom