I have a form for a parent table with a subform displaying child records in a grid control. When a row is added to the grid (and a new child record created) I’d like to populate a field in the grid with the next number in sequence for the parent record, e.g. the first child record for this parent gets a 1, the next a 2, etc.
Similar to auto-numbered tables, but resetting for each new parent record. Think line items on a purchase order. In SQL terms, something like:
select max(LineNumber)+1 as NewLineNumber from ChildTable child where child.OrderNumber = %1;
Is this possible?