Auto serial from high to low
I need to make the "Replace Field Contents" add serial numbers, but go from Highest to Lowest instead of 1 and up. Does anyone know how to do this?
Show all your records, place the cursor into the serial field and do a "Replace Field Contents" NOT with serial, but with calculation:
Start + 1 - Get ( RecordNumber )
Thanks, Ray. But when I do this, my numbers are negative. They start at 0 and go -1, -2, -3, etc. Say I have 20 records, I need it to be 20, 19, 18, 17, etc., all the way down to 1.
Are you using this serial number as a primary key? If so you should allow the usual sequence of numbers. There PK should have no visible or logical meaning to the user. If you're not, what is the purpose of having the serial numbers appear in descending order?
To add, how can you expect to use a descending serial number when you have no way to determine in advance how many records will exist? If you devise a calculation that assigns descending value serial numbers, what's the first number? If you choose 200 what happens when you create record 201? Then you're into negative integers again.
In Raybaudi's example, you need a value for start that is the same size as Get ( FoundCount ) or larger to avoid negative values. But please head Rick's notes of caution.
Retrieving data ...