+ Reply to Thread
Results 1 to 4 of 4

Autonumbering Field

  1. #1
    Registered User
    Join Date
    09-06-2012
    Location
    Montes Claros, MG - Brazil
    MS-Off Ver
    Excel 2003
    Posts
    13

    Autonumbering Field

    Hello, friends!

    I have 2 sheets, like front end and back end.

    In db sheet, there's a table with a field I need to autonumbering. Actually, I did it and it works, but I'm not sure if the best way, cause it can may be making the adding record query a litle slow.

    I did it in two steps:

    #1 - Query for get the last id field value then put into a variable plus 1.

    Please Login or Register  to view this content.

    #2 - Adding Record Query

    Is there a optimized way to do it?

    Thank's for help!

    []'s

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,199

    Re: Autonumbering Field

    Hi, LF83,

    when using Excel you should be able to use the Max-Function for that:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    09-06-2012
    Location
    Montes Claros, MG - Brazil
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Autonumbering Field

    HaHoBe,

    But the db workbook is closed. I access it trhought ADO.

    Thanks for help.

    []'s

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,199

    Re: Autonumbering Field

    Hi, LF83,

    if Excel is always used as Frontend to the Access-db the value could be saved there.

    Please Login or Register  to view this content.
    where Number should be the name of the field holding the Autonumber and tbltramitacao is the name of the table. This has to be augmented by 1 for the new number.

    Ciao,
    Holger

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1