Page 1 of 1

Auto Entry Problem

PostPosted: Tue Apr 11, 2006 1:11 pm
by bkmcse
I am working on a database that I need to have a field that repeats a series of numbers. The field in the first record will be the number 1. When I create a new record I want to auto-enter 2. In the next record 3, but the next one I would like to start over at 1. I can do this with a script, but would like it to run as auto-enter when creating a new record. Is this possible? Can someone show me the required calculation?
Thank You,
Brian

PostPosted: Tue Apr 11, 2006 1:27 pm
by John Sindelar
Assuming you have another field that is an auto incrementing serial number called "serial", you could have an auto enter calc like this for your 123 field:

Choose ( Mod ( Serial ; 3 ) ; 3 ; 1 ; 2 )

PostPosted: Tue Apr 11, 2006 1:33 pm
by bkmcse
Thanks John.
I think this will work. I can create the Serial number field that will count 1,2,3,4 etc and make that not visible. It appares to work for keeping my numbers to 1 2 3 1 2 3. Also thanks for the fast response.

PostPosted: Sat Apr 22, 2006 1:00 pm
by comment
Choose ( Mod ( Serial ; 3 ) ; 3 ; 1 ; 2 )


Mod ( Serial - 1 ; 3 ) + 1

returns the same result.