Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto-incrementing a number field
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Auto-incrementing a number field
Miscellaneous
Thread ID:
00168371
Message ID:
00168371
Views:
74
Hi ALL!

I would like to have the first field on a form auto-increment with each new recorded added to the forms table. I know of the NEWID() way, but this involves modifing the table. Does any have any suggestions on how I can accomplish this useing just code?

I considered useing the last Record number in the table and incrementing it by 1 each time, but No matter where I place my simple code, it gives errors and\or totally flips out the "add" function to the form.

I was useing something like this:

Local lnCount
Select MyTable *** the table to be added to
lnCount = Count + 1
Thisform.firstfield.value = lnCount

Please help!

TIA,
DAN
Dan Gilliland
ICQ# 15695715


"Man is still the most extraordinary computer of all."
John F. Kennedy (1917-1963)
Next
Reply
Map
View

Click here to load this message in the networking platform