Results 1 to 3 of 3
  1. #1
    Moonman is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    8

    Forms Fields and Multiple AutoNumbers

    I am in the process of creating a database that assigns an indexed equipment identification numbers, within a specified number range, based on type of equipment; Major (1000 - 1999), Electrical (2000 - 2999), Instrumentation (3000 - 3999), and Valves (4000 - 4999). I have a form which allows the user to select equipment type and then via a button opens the associated equipment type subform. The subform allows the user additional options and then via a button assigns a equipment id number based on the main form AutoNumber and the Format Fuction as shown below.

    If [Forms]![TREATEquipmentID]![Major] = True Then
    Me!ValveNo = (Format(Forms!TREATEquipmentID!AutoNumber, "1000"))
    End If

    If [Forms]![TREATEquipmentID]![Valves] = True Then
    Me!ValveNo = (Format(Forms!TREATEquipmentID!AutoNumber, "2000"))
    End If

    In an attempt to make the database work, I created specific tables, which include AutoNumbers, for each specific equipment type. This was done since Access will only allow one AutoNumber per table, which I thought would allow me to assign an equipment id based on the specified range. My issue is, I do not know how to get the subform field to get the AutoNumber from the specified table. As long as I use the AutoNumber on the main form everything works perfect, but when I try adding additional AutoNumbers, by whatever means, to get the multiple equipent id ranges required, I fail.
    Also, this method assigns the next sequenchial AutoNumber so you may have 3122 and then 4123, instead of keeping each range separate.

    Any assistance in this matter would be greatly appreciated. As a Access amatuer, there probably is a way to populate a table with the required numbers and then have the database assign the next sequential number.

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,645
    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.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Here is info on Autonumbers:

    Use Autonumbers properly
    http://access.mvps.org/access/general/gen0025.htm


    Autonumbers--What they are NOT and What They Are
    http://www.utteraccess.com/wiki/index.php/Autonumbers


    Microsoft Access Tables: Primary Key Tips and Techniques
    http://www.fmsinc.com/free/newtips/primarykey.asp

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

Similar Threads

  1. Generate Multiple Records with Autonumbers
    By macollins in forum Access
    Replies: 10
    Last Post: 12-09-2013, 03:11 PM
  2. Input Forms - How To Input Multiple Fields/Records?
    By butterbescotch in forum Forms
    Replies: 1
    Last Post: 04-04-2013, 06:30 AM
  3. Multiple forms or embedded sub-forms
    By Juicejam in forum Forms
    Replies: 2
    Last Post: 08-23-2011, 07:31 AM
  4. Supertype / Subtype Autonumbers and Forms
    By stanbridge in forum Access
    Replies: 7
    Last Post: 05-03-2011, 08:54 PM
  5. Multiple Same Fields in Access Forms
    By tlynn1 in forum Forms
    Replies: 1
    Last Post: 06-28-2010, 03:06 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