>Function NextNo
>Calculate Max(Part_no) to m
>Return m + 1
If you delete your last record and add a new one, this means the new one will have the same primary key as the last one. Even if this will work, we always suggest to always use unique key based on an incremental value and not applying a function on the current data.