Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Location
    Cleveland, OH
    Posts
    5

    Unanswered: 2nd autonumber field

    Hello. I think this is a simple problem, but I am stuck. I have a table and the autonumber key is called ID. I am using .asp pages and when a user enters a new record I need another field called LAND_CODE to generate a unique number (either ID+1 or start at 1000 and autonumber by 1). What is the easiest way to do this? thanks for any help!

  2. #2
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    As long as you don't have any dependencies on LAND_CODE you can use the BeforeUpdate event of your form to obtain the ID and add 1000 to it.
    All code ADO/ADOX unless otherwise specified.
    Mike.

  3. #3
    Join Date
    Nov 2003
    Location
    Cleveland, OH
    Posts
    5

    Smile Thanks

    Originally posted by HomerBoo
    As long as you don't have any dependencies on LAND_CODE you can use the BeforeUpdate event of your form to obtain the ID and add 1000 to it.
    Thanks for the help! So in my form, I built this expression in the Land_code field..

    =[BeforeUpdate]([ID]+1000)

    but it doesn't add anything to the Land_Code field. Did I make a stupid mistake?

  4. #4
    Join Date
    Nov 2003
    Location
    Cleveland, OH
    Posts
    5

    Talking Re: Thanks

    Originally posted by bronco191
    Thanks for the help! So in my form, I built this expression in the Land_code field..

    =[BeforeUpdate]([ID]+1000)

    but it doesn't add anything to the Land_Code field. Did I make a stupid mistake?
    Got it! Thanks for all the help!!!!

Posting Permissions

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