Results 1 to 8 of 8
  1. #1
    dbakeg00 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Location
    Texas
    Posts
    4

    Automatic Document Naming

    I'm very new to both Access and to this forum. Please have patience with me.



    I'm looking to design a form in Access that has a documents number field. Ideally, this field would auto-generate a document number based on a logical naming convention. Any thoughts on the best way to go about this? Please let me know if you need any additional information. Thanks in advance.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Have you worked on details of such a (logical naming) process in plain English or with pencil and paper?

    Root base prefix suffix version modifier abbreviation/codification constraints sort of thiing?

  3. #3
    dbakeg00 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Location
    Texas
    Posts
    4
    There is a basic naming convention in place right now (paper format). I will probably want to deviate from it a bit...but not a lot. I'm looking to keep things simple. Here is a rundown of the current naming convention:

    ABCDE-MM-DD-YYYY

    Where the ABCDE is a 5 digit alphabetic code depending on the unit of the plant I work in. The MM,DD,YYYY is just the date the document was created. I'm sure there are better naming conventions out there but, like I said above, I'm trying to keep it simple. My original question is whether VBA programming, a macro, or some other means (which I'm not aware of) would be the best route for my goal.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    If you have a field with the plant unit ID and a field with document date, this unique identifier can be calculated when needed by concatenating the two fields. But is it really unique? Can a unit have more than one document created on the same date?
    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.

  5. #5
    dbakeg00 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Location
    Texas
    Posts
    4
    That's the part of the numbering convention I would like to change. Probably by adding a unique modifier. If I go about it the way you suggest, I guess the best way would be to add some auto-number field to concatenate with the other data?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Autonumber field probably easiest; however, not necessarily best. Autonumbers are supposed to be invisible to users, not part of data that has meaning to users. It's also possible for autonumber to generate negative (at least so I've heard, but never seen).
    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.

  7. #7
    dbakeg00 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Location
    Texas
    Posts
    4
    So the more robust way would be to learn VBA and code the logic?

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Maybe - as noted, I've never seen autonumber do anything but positive increment and many do use as you describe.

    Generating custom unique identifier is a common topic in forum.
    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. Replies: 5
    Last Post: 01-23-2014, 09:36 AM
  2. Naming Forms
    By buckwheat in forum Access
    Replies: 4
    Last Post: 08-06-2013, 01:13 PM
  3. Replies: 3
    Last Post: 02-22-2013, 06:41 AM
  4. Naming scheme thru VBA
    By redbull in forum Programming
    Replies: 10
    Last Post: 04-10-2012, 02:37 PM
  5. Naming conventions
    By Yesideez in forum Database Design
    Replies: 3
    Last Post: 06-29-2011, 08:55 AM

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