AnsweredAssumed Answered

ID Number/Primary Key generated from 2 fields

Question asked by JohhnyHilly on May 20, 2013
Latest reply on May 28, 2013 by JohhnyHilly


ID Number/Primary Key generated from 2 fields


     I am generating an ID number from 2 fields. This ID number is my Primary Key for a table. How it is generated is a Company name is selected, then a Country Code is selected and the ID number is created. This is no problem if I have "Do not replace exsting value of field" unchecked in the field options.

     I want to have this field checked as I don't want the Company ID number to change at all. But if I check that option, once I select the Company, the ID number generates and doesn't allow me to include the Country code, as it can't update. 

     Does anyone know how to get around this without unchecking that Do not replace field..?

     The only thing I can think of is creating an onobjectenter script trigger prevent the Company and CountyCode fields to be changed once they are populated. But even this I don't want to do as at some point a Company name may change, but I want to keep the ID number the same. Thoughts?