Results 1 to 3 of 3

Thread: Autonumbers

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Location
    Kenya
    Posts
    3
    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]

  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    what database are you using ?
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  3. #3
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    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.
    Not nearly so tired now...

    Haven't been around much so be gentle...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width