Results 1 to 4 of 4
  1. #1
    anastazia1117 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    2

    Incrementing Numbers

    I have to enter lot numbers into one column on a table, and most of the time, they are sequential. In Access 2003, when I'd enter two numbers (i.e. "1119301" in row 1, then "1119302" in row 2), Access would predict that I would want "1119303" in row 3 when I pressed the down arrow key.



    Since we've converted to 2010, Access doesn't predict anything anymore, and entering lot numbers is fairly tedious. Does anyone know how to turn this function on or set a script/macro to do it?

    It's for an existing data table. We have records in our database from 2005. The numbers will not all be consecutive. We may only issue 5 lot numbers one day, but the next can be 30 or so. I'm only concerned with the final digit incrementing in the next record.

    I'm doing the entry on a table. I don't care about the previous numbers, just that it does it from this point forward.

    All of the data entry is in Access, not Excel.

    Thanks for your help!!!

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Use a FORM and you can do it. Use the table and you are out of luck. So, wanna use a form?

  3. #3
    anastazia1117 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    2
    I'm open to using the form, as long as it's as quick as it was using the table.

  4. #4
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    You can set the form up to be a datasheet view so it can look like it was the table. But in the form's BeforeUpdate event (not in the event property dialog but in the VBA Window), put this code (with the appropriate names changed to fit your actual control name):

    Code:
    Me.YourControlNameWithTheNumber.DefaultValue = Me.YourControlNameWithTheNumber + 1
    So leave the ME part alone and change the YourControlNameWithTheNumber to be the name of the text box which is bound to the field you want to increment.

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

Similar Threads

  1. Incrementing Counter in Query
    By Rawb in forum Queries
    Replies: 9
    Last Post: 02-10-2011, 02:58 PM
  2. Integer not incrementing
    By jgelpi16 in forum Programming
    Replies: 2
    Last Post: 01-31-2011, 02:40 PM
  3. Incrementing a value in a form
    By erbuchan in forum Access
    Replies: 10
    Last Post: 01-26-2011, 12:33 AM
  4. Incrementing a field
    By Wayne311 in forum Programming
    Replies: 20
    Last Post: 01-20-2011, 06:21 PM
  5. Figure Numbers incrementing over Page Breaks
    By jezzamax in forum Reports
    Replies: 3
    Last Post: 12-19-2010, 08:05 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