I have a form with a subform which is a table of items ordered. I want to have a column in the subform the give the item number which increments for each different item ordered. I basically want a line number for the order form. I currently have it setup using a field called ItemNumber which is data type autonumber. The problem is ItemNumber is not reset to 1 when a new form is started but rather it is keeping track of the number of different items order between records. Should I be using a different command or is there a way to tweak the autonumber to work the way I want?
Autonumber is self incrementing but it can't have the duplicates values so it won't help to store the line numbers. You should use number-long for this and you might've to write custom function to return the correct line number for that order and migh've to call this function from the after insert event of the sub form, but please consider this also if an item is deleted from the sub form - do You want to renumber the list or not?