Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto-incrementing a number field
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00168371
Message ID:
00168409
Views:
22
Sorry Dan, must have hit the enter kit by accident on my last response.

Any way, here is my suggestion:

In your form init method:

SELECT ;
MAX(id_field) ;
FROM table ;
INTO ARRAY aHighestID

IF _TALLY > 0
THISFORM.object.value = aHighestID[1] + 1
ELSE && No records on the table
THISFORM.object.value = 1
ENDIF

This should do it for you.

Good luck
Juan L. Romero
gcandela@javanet.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform