Automatically creating entries from other fields

livin4rocknroll

New member
Local time
Today, 07:00
Joined
Jul 27, 2004
Messages
9
My company uses an ID system that works like this: It takes the first 3 letters of the first and last names and puts them together and then it takes the birthdate and adds it to the end. I was wondering if it was possible for the database to do this automatically From a form. Here is an example of my table the UniqueID column is what I need automatically generated from the other fields. Is this feasible?

| LastName | FirstName | UniqueID | BirthDate |
Cuervo Jose joscue020380 02/03/1980
 
You can use the following expression in your form to create the unique ID:

Left$([FirstName], 3) & Left$([LastName], 3) & Format$([BirthDate], "mmddyy")
 
If you make a new field in a query such as:

NewFieldName:[LastName] & "" & [FirstName] & "" &[UniqueID] & "" &[BirthDate]

A space between the inverted commas will put a space between the fields, that is, the above will give CuervoJose and with a space between the invertd commas you will get Cuervo Jose

You can also do [Field1]+[Field2] etc but you can have foul ups and I prefer to use that for calulations.

Here is a copy of one I use

AgentDetails: [CLGiven Names] & " " & [CLSurname] & " " & "Phone" & " " & [C PhBus] & " " & "Fax" & " " & [ExtraField10] & " " & "Mobile" & " " & [Cancel]

In that case the words Phone, Fax and Mobile have also been inserted between the field details.

Edit. Just saw other post and realised I did not read this one properly :D

Mike
 
Last edited:

Users who are viewing this thread

Back
Top Bottom