I don't understand exactly what this means
DLast("Hour","tblProductionByHour","JobID=" & [JobID])
In the end I will have to average the "sets per hour" by totaling the total number of sets completed by the "Hours" taken. So I am trying to extract the value of the "Hour" field in the last row of tblProductionByHour where JobID=JobID.
What I can say is that DLast does not get you the last (latest) record in a table.
If you have a table whose records contain, say FinishedDate. You can find the record with the latest entry (logically the last record in the table) using a query such as:
Code:
Select yourfield1, yourfieldX from YourTableName
Where FinishedDate =(Select Max(FinishedDate) from yourTableName)
Here the subquery (green) retrieves the latest FinishedDate. The base query finds the record in the table whose FinishedDate equals that maximum value.