Hi,
I have two fields. One is called firstname the other is called surname.
I want to take the first 3 letters of the surname and the first 3 letters of the firstname and combine them to create the primary key (called CustomerID).
So basically, the user enters his firstname and surname, then the CustomerID is filled automatically using 3 letters from the surname and 3 letters from the firstname.
E.g.
CustomerID: JONSAM
Firstname: Samuel
Surname Jones
The CustomerID fills automatically using the firstname and surname fields.
But what if the firstname is Jo and the surname is Li. Then it should take 2 letters from the surname and 2 from the firstname. What happens if there are two samuel jones in the database? ie someone with the same name? Then a unique number should be attatched to the primary key.
This way, on a search form, the user types the primary key, instead of the surname and firstname, and has more chance of remembering it.
Any help would be appreciated.
I have two fields. One is called firstname the other is called surname.
I want to take the first 3 letters of the surname and the first 3 letters of the firstname and combine them to create the primary key (called CustomerID).
So basically, the user enters his firstname and surname, then the CustomerID is filled automatically using 3 letters from the surname and 3 letters from the firstname.
E.g.
CustomerID: JONSAM
Firstname: Samuel
Surname Jones
The CustomerID fills automatically using the firstname and surname fields.
But what if the firstname is Jo and the surname is Li. Then it should take 2 letters from the surname and 2 from the firstname. What happens if there are two samuel jones in the database? ie someone with the same name? Then a unique number should be attatched to the primary key.
This way, on a search form, the user types the primary key, instead of the surname and firstname, and has more chance of remembering it.
Any help would be appreciated.