Incremental number

xaysana

Registered User.
Local time
Today, 20:35
Joined
Aug 31, 2006
Messages
94
Dear All,

I have a column called AsiaCode in my database table to hold 5 incrementable digits.

I need to set 00000 as defaut value, everytime when new records are added, the numbers will incrementally be increasing added such as from 00000 to 00001, 000002...00012... so on.

How Can I do this?.

May be I should post my database onto this forum too, If Could anyone please modify it and get around this but it seems too big to post.

I would really appreciate if you could help me on this issue.

Thank you in advance.
Xaysana
 
Last edited:
Seems you could create a function that increments a number in a global variable by one and puts it back into the global variable as well as outputting it. When you run the code to append the new records, start off by setting the global variable to 0 and then include the function in the append statement for that field.
 
format the column using "00000" and increment as you would any other number field.


EDIT: if the code is stored as a string, simply
Code:
format(strCode+1,"00000")
 
Last edited:

Users who are viewing this thread

Back
Top Bottom