J
J
I need help with a complicated (for me) query. My setup is as follows
tblSolutionBatch
SolutionBatchID
tblSolutionSolvents
PK_ID
SolutionBatch_ID(fk)
SolventName
AmtUsed
PercentWeight
tblSolutionChemicals
PK_ID
SolutionBatch_ID(fk)
SolventName
AmtUsed
tblProcessRuns
RunID
TblRunBatches
RunID(fk)
SolutionBatchID(fk)
AmtSolution
Solution batches are comprised of one or more Chemicals and Solvents.
Process Runs usually only contain one SolutionBatch but they could have more
than one hence tblRunBatches. I have a form for tblSolutions with a subform
each for tblSolutionChemicals and tblSolutionSolvents. In the subforms I sum
the AmtUsed and then have a TotalSolutionMass in the main form. In the
tblSolutionChemical subform I also calculate GramsMetal as AmtUsed x
PercentWeight and Wt%Metal as GramsMetal/TotalSolutionMass for every
Chemical. So far that’s working on the form but now I need a Total of
Wt%Metal but when I try to sum Wt%Metal it causes the other calculations to
give me a ?Name error. I also decided I need the Wt%Metal sum in a query that
will join tblProcessRuns in the equation which brings in tblRunBatches.
I’m up to 3 queries to get the TotalSolutionMass and am getting lost. Can
someone help me out of this tangle, thanks.
tblSolutionBatch
SolutionBatchID
tblSolutionSolvents
PK_ID
SolutionBatch_ID(fk)
SolventName
AmtUsed
PercentWeight
tblSolutionChemicals
PK_ID
SolutionBatch_ID(fk)
SolventName
AmtUsed
tblProcessRuns
RunID
TblRunBatches
RunID(fk)
SolutionBatchID(fk)
AmtSolution
Solution batches are comprised of one or more Chemicals and Solvents.
Process Runs usually only contain one SolutionBatch but they could have more
than one hence tblRunBatches. I have a form for tblSolutions with a subform
each for tblSolutionChemicals and tblSolutionSolvents. In the subforms I sum
the AmtUsed and then have a TotalSolutionMass in the main form. In the
tblSolutionChemical subform I also calculate GramsMetal as AmtUsed x
PercentWeight and Wt%Metal as GramsMetal/TotalSolutionMass for every
Chemical. So far that’s working on the form but now I need a Total of
Wt%Metal but when I try to sum Wt%Metal it causes the other calculations to
give me a ?Name error. I also decided I need the Wt%Metal sum in a query that
will join tblProcessRuns in the equation which brings in tblRunBatches.
I’m up to 3 queries to get the TotalSolutionMass and am getting lost. Can
someone help me out of this tangle, thanks.