3 Replies Latest reply on Feb 7, 2011 5:20 PM by DavidB3005

    Generating unique client numbers based on field option choices

    DavidB3005

      Title

      Generating unique client numbers based on field option choices

      Post

      I need to generate a number based on the result of a field's options, and this number needs to be unique, increasing, and dependent on the outcome of a field option. For example, the field Nature of Exam has 5 options. If I choose option 1, my choice auto populates a customer number field with P11/0001 for the first instance, P11/0002 for the second instance, and so on. If my choice is option 2 or 3 or 4 or 5, that same field is then populated with H11/0001, etc. The two counts are independent of each other. I am racking my brains trying to figure out how to do this as I am not very familiar with functions. Any help would be appreciated.

      thanks

      David

        • 1. Re: Generating unique client numbers based on field option choices
          davidanders

          Five Global Fields - one for each choice, set to 0001 or what the next number is.

          When the option 1 is selected the customer field is set and the correct global field is incremented by one?

          • 2. Re: Generating unique client numbers based on field option choices
            philmodjunk

            Careful, many approaches you could use here will fail for cases where you have more than one person generating such numbers at the same time using a file that is hosted over your network. The wrong approach here can result in duplicate values if two or more such operations are initiated at nearly the same time by different users.

            Hence this question: Will there be different users on a network doing this at the same time or will this be a single user system?

            • 3. Re: Generating unique client numbers based on field option choices
              DavidB3005

              This is a kind of sign up sheet. Sorry if my explanation is rather confusing. when the information is entered in the record, the client number is generated based on which value is selected in the field Nature of Exam. One of the values returns a number with P and the other 4 values return a number with H. These numbers are separate, that is to say, if the first value is chosen, it needs to populate the client number with P11/0001. Any subsequent choices of the first value return client numbers which increase by one each time, like a serial number. Any of the other 4 values returns a client number with H, that is, it starts at H11/0001 and also increases with each of hte other 4 choices of the value in Nature of Exam. The P numbers and H numbers are independent, that is to say, choosing value 1 gives P11/0001, choosing it again prvides P11/0002, etc.  If one of the other values is chosen it provides a number preceded by H which also increases in like manner, but does not increase based on  a general choice in field Nature of Exam, the way a simple serial would do. P numbers increase independently of H numbers.

              This is a closed system. It will be used by one person only.