Jeff sorry it took so long to get back to you.
Here is what I've done:
Created a table (tbl PO) with the following fields:
PO#(As primary field), Vendor,material type, inspected by, location
With exception of PO# the rest get their info from other tables
My second table (tbl Percent) has the following:
PO#, Ptype%, paper%,H20%, other materials%, other plastics%
Its primary relationship is PO#
I've vreated a query as follow:
SELECT DISTINCTROW [tbl PO].[PO#], Avg([tbl percent].[Type%]) AS [Avg Of
Type%], Avg([tbl percent].[Paper%]) AS [Avg Of Paper%], Avg([tbl
percent].[H2O%]) AS [Avg Of H2O%], Avg([tbl percent].[Other Materials]) AS
[Avg Of Other Materials], Avg([tbl percent].[Other Plastic]) AS [Avg Of
Other
Plastic]
FROM [tbl PO] INNER JOIN [tbl percent] ON [tbl PO].[PO#] = [tbl
percent].[PO#]
GROUP BY [tbl PO].[PO#];
I've also created the following:
frm 1 - its record source is tbl PO. In this form I have a sub form that
inputs data to tbl percent.
frm Total - its record source is : SELECT [tbl PO].[PO#], [tbl PO].Vendor,
[tbl PO].[Material Type], [tbl PO].[Number of Bales], [tbl PO].[Inspected
by], [tbl PO].Location, [tbl PO].Notes, [Table1 Query].[Avg Of Type%],
[Table1 Query].[Avg Of Paper%], [Table1 Query].[Avg Of H2O%], [Table1
Query].[Avg Of Other Materials], [Table1 Query].[Avg Of Other Plastic]
FROM
[Table1 Query] INNER JOIN [tbl PO] ON [Table1 Query].[PO#]=[tbl PO].[PO#];
Now everything is working as planned but I don't know how to get the sum
from
the fields Avg Of Paper% + avg Of Other Materials + avg Of Other Plastics
that is in tbl Total. Also, How do I point this total to a preset criteria
based on the material type? this criteria varies between percentages of
contaminants.
Any help would be great! Please remember I'm still wet behind the ears
when
it comes to Access.
Thanks in advance
Evert
Jeff Boyce said:
Evert
Since "how" depends on "what", what is your underlying data structure?
Regards
Jeff Boyce
Microsoft Office/Access MVP
Hello,
I put togheater a database with the help of some of your responses. For
this
I thank you.
I need to be able to categorize the results of fields on a table, based
on
a
preset criteria.
For example: if the sum of Paper%+OtherMaterial%+OtherPlastic% >=26
it
should show 2 on a text box in the form. Otherwise it would show other
values
not necessarily number.
I have been trying to get this with different methods such as Sum,
Dsum,
IF,
Iif and can't get it to work.
any help you could give me is much appreciated.
Evert