Are you using the autonumber attribute?
If so: you don't have control over that number, except the default value, which is the number where it starts counting.
If you want to have an increasing autonumber, which ensures no gaps; pic a integer attribute and microflow to defin the number.
Next to that; what are you checking on index??