Results 1 to 6 of 6
  1. #1
    Kero is offline Novice
    Windows XP Access 2000
    Join Date
    Apr 2011
    Posts
    3

    Automate Number Generation

    Hi, I'm new to the forum and apologize in advance if this question has been asked before. I reviewed the forum and feel overwhelmed by the amount of information that is out there on so many various situations.


    What I'm trying to do is make a table in Access 2000, which for the most part, is going over well, except I can't figure out to get it to automatically generate a number for me. I've tried AutoNumber and get a random sequence of numbers which does me no good.

    The idea is that I'm trying to make a table that I can use to organize and input data into to organize my company's purchase orders.

    For example...
    The number I want to have automatically generated "PO-120050", the next one I want it to generate would be "PO-120051" then "PO-120052" and so forth.



    I have like 6 other fields I'm currently using to input other data.

    So far, the closest thing I managed to get is to auto-format my number, so all I have to do is enter "120050" and it changes the formatting to "PO-120050" but if possible, I'd like to get the whole number to automatically generate and not allow duplications of course.


    Hopefully, I didn't overly confuse everyone and what I have in my head is actually possible.

    I look forward to seeing anyone respond, and thank you in advance.
    -Kero

  2. #2
    CCW8 is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2011
    Posts
    8
    If you have the field set to auto number, it should generate the number for you when you move to the next recordset with the tab key. Are you progressing to the next record through a form or the table?

  3. #3
    Kero is offline Novice
    Windows XP Access 2000
    Join Date
    Apr 2011
    Posts
    3
    Currently, I'm creating this all through a table.

    I got two different results from AutoNumber, first it went 1, 2, 3, 4, etc.

    Then when I tried to mess with the formatting and such, it gave me a completely random sequence of numbers and letters. I have no idea what I did to generate that.

    So I ended up deleting that particular field and tried to start over anew.

  4. #4
    Kero is offline Novice
    Windows XP Access 2000
    Join Date
    Apr 2011
    Posts
    3
    Okay, I think I may have made some slight progress.

    I have it auto-generating numbers with the formatting I want, but unfortunately, it's starting from PO-1.

    Is there a way I can set it up to start from a designated number? I'd like it if I could get it to start at 120050, that'd be great.

  5. #5
    CCW8 is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2011
    Posts
    8
    Okay, so while in the table if you switch to design view, you will see your set up of each field. There you can ensure your field is set to autonumber and use the input mask to generate the format you like. In many cases, when you are setting a field to autonumber, you will want it to be the "Primary Key" which you can make happen either from the tools menu or right click on the line of the field. Then switch back to table view. As you enter data and wrap down to the next line it will generate a number for you.

  6. #6
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254

    Just a thought...

    Kero - In the table, what is being stored, "PO - 120050" OR "120050"?
    If it is "PO - 120050" then, I don't think you need the "PO -" portion as this is just repetitive and needless data. You know and there are ways to insure that the users know that this is a "PO-". The actual unique identifier is "120050", "120051" and so forth and so on. You can always change the caption or label portion of a control on a form or report to "PO -" in order to easily identify it.

    Personally, I would start by eliminating the text portion of the data, set the field to autonumber, and set the format property to 000000.

    As always, make a copy of the db first before attempting a revision.

    Hope this helps.

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

Similar Threads

  1. Automatic Next number generation
    By MicroMan in forum Programming
    Replies: 17
    Last Post: 10-21-2011, 05:57 PM
  2. Replies: 3
    Last Post: 02-22-2011, 01:28 PM
  3. Password generation does not seem random
    By ducecoop in forum Access
    Replies: 6
    Last Post: 11-15-2010, 02:37 PM
  4. Automatic Report Generation - Access VBA
    By initiator in forum Programming
    Replies: 2
    Last Post: 04-19-2010, 05:10 AM
  5. Correspondence Reference Number Generation
    By ildanach in forum Forms
    Replies: 1
    Last Post: 04-28-2009, 12:09 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