G
Guest
Hi there
I'm looking to find a way to assign a 'line number' on each record on a sub form (write to the table) and then with the next header record, start at 1 again and assign the new line numbers for the sub records associated with that header record
I thought something like below would work, but I'm not sure how to apply -
do I need to use insert statement to enter the number into my field (how would this look)
And then how do I get it to reset for the next set of sub records
Dim NextReceiptLineNo As Lon
If IsNull(DMax("[ReceiptLineNo]", "tblReceiptLines")) The
NextReceiptLineNo = 1
Els
NextReceiptReceiptLineNo = DMax("[ReceiptLineNo]", "tblReceiptLines") +
End I
NextReceiptLineNo = DMax("[ReceiptLineNo]", "tblReceiptLines") +
Thank
Shawn
I'm looking to find a way to assign a 'line number' on each record on a sub form (write to the table) and then with the next header record, start at 1 again and assign the new line numbers for the sub records associated with that header record
I thought something like below would work, but I'm not sure how to apply -
do I need to use insert statement to enter the number into my field (how would this look)
And then how do I get it to reset for the next set of sub records
Dim NextReceiptLineNo As Lon
If IsNull(DMax("[ReceiptLineNo]", "tblReceiptLines")) The
NextReceiptLineNo = 1
Els
NextReceiptReceiptLineNo = DMax("[ReceiptLineNo]", "tblReceiptLines") +
End I
NextReceiptLineNo = DMax("[ReceiptLineNo]", "tblReceiptLines") +
Thank
Shawn