Hi,
Read in this Link....
How to organize auto-increment key field in VFP?
faq184-259
If this is not enough, can suggest much more ways... ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK
Hi...
In your save button, you can add the following code, to get this implemented quickly.
LOCAL lcAlias, lnAuto
lcAlias = ALIAS() && used to store back default alias
lnAuto = 0
SELECT 0
USE myTable ORDER myKey AGAIN && myKey is AutoNumber Field
GO BOTTOM
lnAuto = 1+myKeyField && auto number field
USE
SELECT lcAlias
myKeyField = lnAuto
... proceed to write....
Remember to put the above codes within the folds of locking routines so that the number is not used by another in the mean time.
I am using the above approach in many of my DBFs
Note you are using the DBF again so that the current DBFs pointer is not gtting moved and the rlated consequences.
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK
Another way is to have a free table with one record in it.
Open the free table and incriment the field by one.
If you add a year and month field to it you can also use it for invoice numbers.
This routine will automatically reset the Year/month/invoice field each month.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.