Ok,
First of all these tables are from an open source(i think that is the term for this)program that we have, that is 90% Ms Access databases, so the choice of feilds is pretty much what i have to work with.
tblOPTOffcuts has thses feilds: OffcutNo[number], MatID [number], Lenght [number], width [number], qty [number], and offcutID [autonumber], i managed to add the offcut ID feild to the table and change the databse back to a 97 version and give it back to the program and it did not complain about it. I use that feild in the shop to label my offcut for tracking and finding them.
this is the SQL of the main report:
SELECT PanelLayout.MatID, PanelLayout.PatNo, Materials.Name, Materials.Width, Materials.Length, ([materials].[width]*[materials].[length])/144 AS sqFeet, Materials.Offcut, Materials.MatDBID, Job.CNCRunNo, Job.Name AS JobNumber
FROM Job INNER JOIN (PanelLayout INNER JOIN Materials ON PanelLayout.MatID = Materials.ID) ON Job.ID = PanelLayout.JobID
GROUP BY PanelLayout.MatID, PanelLayout.PatNo, Materials.Name, Materials.Width, Materials.Length, ([materials].[width]*[materials].[length])/144, Materials.Offcut, Materials.MatDBID, Job.CNCRunNo, Job.Name
HAVING (((Materials.Offcut)=False));
this is the sql of the sub report:
SELECT PanelLayout.MatID, PanelLayout.PatNo, Materials.Name, Materials.Offcut, ([materials].[width]*[materials].[length])/144 AS sqFeet, [tbl OptOffcuts].OffcutID, Round([materials].[width],6) AS width, Round([materials].[length],6) AS lenght, Materials.MatDBID
FROM (PanelLayout INNER JOIN Materials ON PanelLayout.MatID = Materials.ID) INNER JOIN [tbl OptOffcuts] ON (Materials.MatDBID = [tbl OptOffcuts].MatID) AND (Materials.Width = [tbl OptOffcuts].Width)
GROUP BY PanelLayout.MatID, PanelLayout.PatNo, Materials.Name, Materials.Offcut, ([materials].[width]*[materials].[length])/144, [tbl OptOffcuts].OffcutID, Round([materials].[width],6), Round([materials].[length],6), Materials.MatDBID
HAVING (((Materials.Offcut)=True));
i understand this may not give you that much, but its kinda pretty complicated to explain the entire thing, let me know if you need more....
Thanks,
Sylvain