-
I designed a form using visual basic as the interface and access as the database for customer entry of data. I did use the record count method to ensure that the customer ID is autonumber. However, when deleting a customer record and upon adding new records the same number is used, and the previous records customer IDs are changed. How can I solve the problem programmatically? Please help.
Vincent
[Edited by Kiptalam on 12-07-2000 at 01:00 AM]
-
what database are you using ?
-
Don't use recordcount, it is inherently unstable. If you are using Access, you could set a field to be an AutoNumber, if you are using SQL Server you could declare the column in your table to have 'Identity' as a property. Also add a UNIQUE constraint.
Other DBEs have similar tools.
The only other approach is to have an external table that tracks IDs that have been used (whether or not the record still exists) and then add one to the last number used for each new record.
Cheers,
P.