You should start the debugging process by setting variables and using the Data Viewer to check their value (or a custom dialog if you don't have FMPA).
Go to Record [ First ]
Set Variable [ $this.id ; Members::KP_MemberID ]
Set Variable [ $increment.value ; 10 ]
Set Variable [ $next.serial ; $this.id + $increment ]
Set Next Serial Value [ Members::KP_MemberID ; $next.serial ]
Do you do an error trap right after the "set next serial value"? If so, does come back with an error?
Are you running the script with full access privileges and if you go to Define fields after the script runs, what is the next value? Do you by any chance have an auto-entry option for the PK that might be causing the problem.
I stepped through the script with 'Pause On Error' checked and did not get an error ....except I noticed that further up in the script and PRIOR to executing this part of the script, I go to various layouts and execute a 'Delete all records' command which, oddly enough, generates a Error 3 : Command Unavailable. But, the command seems to execute.
Your PK has an auto-enter. This will override the next value.
The problem was NOT in the script that defined the Set Next Serial Value. That part is working.
The problem was in my 'Add New Record Script'. For reasons not now known to me, (I've been working on this app for almost 2 years) I put in a Set Next Serial Value = PK +1.
I commented it out and all works as expected....
As usual, it is somehow my fault. Thanks to all for directing me toward the solution.