1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Access 2007 Custom Autonumber

Discussion in 'Business Applications' started by travelchick, Jan 6, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. travelchick

    travelchick Thread Starter

    Joined:
    Jan 6, 2011
    Messages:
    4
    This forum seems great, so I'm hoping someone can help me. I need to create a field that has the year and then an auto-number. Like 2011-135. However, there's a catch. There are already records in my DB that I don't want changed. (Last year, people manually entered 2010-##.) So, how can I: a) create this field, and b) make it start with only new records entered?

    thanks!
     
  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
  3. travelchick

    travelchick Thread Starter

    Joined:
    Jan 6, 2011
    Messages:
    4
    yes. I'd like each new year to start at 001.

    Thanks!
     
  4. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    So what is the name of the Table and the name of the Field that has this number?
     
  5. travelchick

    travelchick Thread Starter

    Joined:
    Jan 6, 2011
    Messages:
    4
    Okay, I'm back. I was out a couple of days.

    The table is "Investigations" and the field that has the autonumber is called "AutoID". That is a hidden field. I've also got another field I was allowing users to enter a number manually in the formate YYYY-###. That is called "Case#".
     
  6. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Shouldn't you copy the contents of Case# in to AutoID before setting up the VBA code?
     
  7. travelchick

    travelchick Thread Starter

    Joined:
    Jan 6, 2011
    Messages:
    4
    That would be ideal, but I didn't know that you could copy info into an autonumber field.
     
  8. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    The new field that will hold the VBA Generated and Incremented number can't be an Autonumber field, it has to be text.
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/972962

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice