View Full Version : Calculating a total based on population of yes/no boxes?


jpahern
11-06-2000, 09:21 AM
Hello all.

I have a form. Two tables are represented. The first lists units (s/n, model, finish) and the other is a table of defects (auto number, defect name, weighted value).

I know this should be easy, but for some reason the best way to do it is escaping me at the moment.

I would like to look at a form that shows the S/N, Model, Finish and then at the bottom has a listing of all 99 possible defects. The users will go down the list and check off the defects that are found and the total value for defects will be calculated for all checked boxes.

How do I assign a the value to these check boxes, so that it is either null or the value listed in the table with the defects?

Thanks,
jason

Pat Hartman
11-06-2000, 04:00 PM
You need a third table to store the many-to-many relationship between units and defects.
The third table only needs two columns:
S/N (assuming this is the unique key for the units table)
DefectID (the autonumber key of the defect table)
The table key should be both keys so the same defect cannot be entered more than once for a unit.

Then create a subform where the defect information can be entered. The subform will have only one visible field per record. A combobox that displays the potential defects.

[This message has been edited by Pat Hartman (edited 11-06-2000).]

Carol
11-06-2000, 04:08 PM
The defect table should also hold the defect value assigned to it if you are planning to use the value in calculations. If you are just planning to count how many defects recorded per defect then you could use an underlying query and a subform using the "Count" Function.