Question Creating a unique ID

stefan.ward

New member
Local time
Today, 20:03
Joined
May 3, 2009
Messages
2
Is there a way to create a unique ID field using the first 3 letters of a last name field with an autonumber.

Thanks,
 
Yes, but it is recommended to simply use an autonumber.

edit-The better thing to do is us an autonumber for the primary key, on the form, add a control that displays me!lastname left3 & me![id]. I do not know the syntax of left, so I can't do it for you. Google is your friend.
 
Yeah i would prefer to create an autonumber, but its part of my ICT exam.

We get a pre release of what a 'company' would like us to do.
This years is a train company who says

"The customer must enter at least their last name, the first line of their address and their post code. There will be the option on this form to confirm or cancel the booking. If the cancel button is pressed then nothing is stored. If the confirm button is pressed then the customer is assigned a unique identification (Customer ID), which consists of the first three characters of their last name followed by a four digit number. The customer’s data is then saved and the seat is reserved by linking their identification to the relevant seat booking and the system is updated. If a seat is still available then it will contain the word “Free” instead of a Customer ID."

Know its a mouthful, sorry about that

 
Don't hard-code this into the table. On the table, simply use an autonumber. On the form, do not display the autonumber. Add a control that displays left 3 of the customers name, and the id. Thats the easiest way to do this without compromising your primary key.
 

Users who are viewing this thread

Back
Top Bottom