doctorswamp
Technical User
Hi
I have a form + subform to record movements of batches of garden plants from stock. The Batches in the subform can be categorised in a BatchType field as Saleable, Growing or NewlySeeded.
I'd like to total the Saleable items only, and have tried creating an unbound field in the subform footer and setting its ControlSource property to an SQL statement that looks like this
="SELECT me.Batches.ItemID, me.Batches.BatchType, Sum(me.Batches.Quantity) AS TotalQuantity FROM Batches GROUP BY me.Batches.ItemID, me.Batches.BatchType HAVING (((me.Batches.BatchType)="Saleable"))"
It gives me error messages about syntax.
Is this a sensible way to be trying to arrive at the total, and if so what might the syntax error be?
Thanks
I have a form + subform to record movements of batches of garden plants from stock. The Batches in the subform can be categorised in a BatchType field as Saleable, Growing or NewlySeeded.
I'd like to total the Saleable items only, and have tried creating an unbound field in the subform footer and setting its ControlSource property to an SQL statement that looks like this
="SELECT me.Batches.ItemID, me.Batches.BatchType, Sum(me.Batches.Quantity) AS TotalQuantity FROM Batches GROUP BY me.Batches.ItemID, me.Batches.BatchType HAVING (((me.Batches.BatchType)="Saleable"))"
It gives me error messages about syntax.
Is this a sensible way to be trying to arrive at the total, and if so what might the syntax error be?
Thanks