Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Auto-incrementing a number field
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Auto-incrementing a number field
Divers
Thread ID:
00168371
Message ID:
00168371
Vues:
69
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)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform