1 Reply Latest reply on Sep 11, 2009 6:59 AM by ninja

    primary key- combination of auto serial number and letters

    njoyce

      Title

      primary key- combination of auto serial number and letters

      Post

      I want to make a primary key that is the initials of the person and then have a serial number automatically entered.  So that if i  have a field with the person's initials (NJ for example) the primary key would look like NJ001, and the next person entered would be MC002 and so on.  is there a way to do this?  alternatively, it doesn't matter to me if it goes 001-009 or whatnot, as long as there is a unique number next to the person's initials. I tried using initials&random as the calculation, but the number was a decimal point and was way too long.  Is it possible to shorten it?

       

      thanks 

        • 1. Re: primary key- combination of auto serial number and letters
          ninja
            

          Howdy njyoce,

           

          Three fields:

          Autoenter Serial

          User's initials (calc field): Case (Get(AccountName)="njoyce";"NJ"; etc...)

          Key Field (Autoenter Calculation)  = UserInitials & Autoenter Serial

           

          But wouldn't you get the same utility by simply having an autoenter serial and a field with Get(accountname) ?

          What do you gain by having a calculated key field with initials in it that you wouldn't have with the user's name tagged to the record?