Results 1 to 3 of 3
  1. #1
    dgutsche is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    35

    Question Auto Number Using a Field and Letters


    Okay I have asked this question in other forms and forums before but haven't come up with an answer that works. The big issue is wanting to create the following records in a subform every time a new record in the subform is added. I can populate the Ticket field and know how to cast fields as strings to append them (so I can get the Cylinder field). The output is used to populate a table called Cylinders. My question is:

    How do I create a field of letters (or numbers) corresponding to the row in the subform without continuing from the previous letter (or number) in the Cylinders table?

    Ticket Letter Cylinder
    1589 A 1589A
    1589 B 1589B
    1600 C 1600C
    1600 D 1600D
    1600 E 1600E

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    If the master record Ticket = 1600
    you'd need a NEW button to add new record.
    Code:
    vLastLettr  = Max([letter],"tSubTbl","[ticket]=" & txtTicket)     (to get the last letter
    vNewLetter = chr(asc(vLastLettr )+1)
    [LETTER]=vNewLetter
    [Cylinder]=[ticket] & vNewLetter

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    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. Add an Auto Number field
    By jrmbach in forum Access
    Replies: 1
    Last Post: 06-13-2014, 04:32 PM
  2. Adding Auto Number field
    By jrmbach in forum Access
    Replies: 1
    Last Post: 08-12-2013, 04:30 PM
  3. Null value in an auto-number field
    By mharkin in forum Import/Export Data
    Replies: 9
    Last Post: 10-03-2012, 07:43 AM
  4. Replies: 1
    Last Post: 05-22-2012, 10:46 AM
  5. Auto number a field
    By jenncivello in forum Access
    Replies: 2
    Last Post: 11-16-2011, 11:28 AM

Tags for this Thread

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