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

Thanks for the suggestion. THis looks like the best waay to accomplish it.
However, I am running into a problem when editing a record, it
changes the assigned number with a new number (MAx, etc...)

How can I use this method ONLY when ADDING , not editing a record.

TIA,
Dan
Dan Gilliland
ICQ# 15695715


"Man is still the most extraordinary computer of all."
John F. Kennedy (1917-1963)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform