Results 1 to 3 of 3
  1. #1
    Head Freeze is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2017
    Location
    Hawkesbury
    Posts
    1

    Question How to ADD 1 to start number down a column ??

    Hello all.

    I need a little help please.
    I was able to do this back in 2000 but have forgotten how I did it.

    I am running Access 2010 database for customers that we deliver to every week.
    Customer name
    Address


    Date
    Docket Number
    etc, etc.

    First customer may get docket number 195226
    second one gets 195227.and so on. (previous number plus 1)
    I am entering these docket numbers manually all the way don the column and it's wasting time.

    How am I able to get Access to enter the next number automatically each time I hit Enter or the down arrow please ?

  2. #2
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Maybe use the Form current event.
    Code:
    Private Sub Form_Current()
        If Me.NewRecord Then
            Me.DocketNumber = DMax("DocketNumber", "YourTableName") + 1  '<<< change YourTableName to the name of the table that holds DocketNumber
        End If
    End Sub
    For the control, you might consider setting the Enabled property to False and the Locked property to TRUE.


    BTW, DON'T use spaces in object names.
    "Date" is a reserved word in Access and, by itself, not very descriptive. "Date" of What???? Birth date? Date of entry??

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Generating a custom unique identifier is a common topic. Here is one https://www.accessforums.net/showthread.php?t=23329
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. delete rows that do not start with a number
    By Homegrownandy in forum Programming
    Replies: 9
    Last Post: 04-11-2017, 07:22 AM
  2. Replies: 3
    Last Post: 03-04-2015, 10:30 AM
  3. Replies: 1
    Last Post: 01-31-2014, 11:03 PM
  4. Start Autonumber at a specific number
    By EmptyPage in forum Access
    Replies: 2
    Last Post: 12-20-2013, 02:28 AM
  5. Replies: 11
    Last Post: 08-04-2010, 04:26 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