Results 1 to 4 of 4
  1. #1
    jhillbrown is offline Novice
    Windows XP Access 2000
    Join Date
    Feb 2010
    Posts
    6

    Find Maximum Value of a Field and Add 1


    When I create a new record in a form, I need the ID field on the form to automatically be the highest number found in the ID field plus 1. The table name is tblContacts. Is there a formula for this and where do I put it? Autonumber is not an option. Thanks!!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You can use the DMax() function to find the largest value, and add 1 to the result. It would be done in code, at whatever point is appropriate to your application.
    Last edited by pbaldy; 03-11-2010 at 11:41 AM. Reason: fix spelling goof
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    Just fixing the typo:

    DMaz() function

    should be:

    DMax() function

    Cheers,

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Thanks, I've corrected the post.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 05-04-2019, 09:02 PM
  2. find value of selected field in a table
    By Bic in forum Programming
    Replies: 1
    Last Post: 02-05-2010, 07:40 PM
  3. Find Spaces in Field
    By stottle in forum Queries
    Replies: 6
    Last Post: 08-17-2009, 02:02 AM
  4. Replies: 4
    Last Post: 07-22-2009, 02:33 PM
  5. query to find the highest value in a field
    By jhjarvie in forum Queries
    Replies: 0
    Last Post: 09-02-2008, 02:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums