Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

populate 1 field from 2 fields 1

Status
Not open for further replies.

mfd115

Technical User
Apr 7, 2002
2
US
Im a novice to Access 2003, but getting better. I have a table with three fields in it, ie.. EmployeeID, fname, lname.
What i want to do is to combine the lname field with the first letter of the fname field to create the EmployeeID field. From this; John Doe, to this; Doej.
I know (or think) this should be done at the after update event of the lname event, but cannot get it to work right. Any help please, thank you.
 
A starting point:
Me!EmployeeID = Trim(Me!lname) & Left(Me!fname, 1)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
But it will be a problem if the employees' names start with same letters.. Like "John Doe" or "James Doe"

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Thanks for the help, works great.
 
Why would you TRIM Lname?

Clearly it worked, but Why wouldn't it just be:

Me!EmployeeID = (Me!lname) & Left(Me!fname,1)

?
 
How are ya mfd115 . . .

The values in your EmployeeID field only need to be unique. [blue]The simplest, easiest unique generated values come from incrementing a numeric value[/blue] (like autonumber). Why not do this and be done with it? [surprise]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top