Results 1 to 2 of 2
  1. #1
    Lorlai is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    107

    AutoIncrement a string

    I have a form that takes input from a user (name, description, etc) to store into a table for later use. I am trying to create a hidden textbox that will incorporate some of the user input to create an ID. The user will input the Track (selected from a combobox). The ID number is composed of the following: [Track]_BSxx, where xx is an incremental number that will increase by 1 for each new name within the Track.

    HR_BS01
    HR_BS02
    IT_BS01
    ACT_BS01
    ACT_BS02
    etc.



    Is there a way to auto increment the xx portion of the ID number based on the most recent number on the track? Currently, I have the default value of the IDnumberTextBox set to: =[Track] & "_BS", but cannot figure out the end portion.


    Any help is greatly appreciated!

  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,870
    You seem to be building a lot of intelligence into a code/identifier. Have you really considered using separate fields for separate facts? I've seen a lot of good intentions breaking down when some "definite, everlasting thing" changes for some "it should never have happened" reason.
    What does the _BS represent?

    Here's an article on atomic fields and values - it's worth the read.
    http://forums.aspfree.com/attachment...2&d=1201055452

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

Similar Threads

  1. AutoIncrement Number
    By burrina in forum Queries
    Replies: 2
    Last Post: 01-30-2013, 08:00 PM
  2. Alphabet autoincrement
    By KWHAT in forum Access
    Replies: 16
    Last Post: 05-23-2012, 08:29 AM
  3. Replies: 1
    Last Post: 05-22-2012, 10:46 AM
  4. Vba string
    By rchtan in forum Programming
    Replies: 5
    Last Post: 05-17-2012, 04:29 AM
  5. Replies: 11
    Last Post: 02-13-2012, 10:06 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