(Q) I have a Name field in my table which contains user names in the format "Doe,
John". How can I easily separate them into individual fields, LastName and FirstName?
(A) Using the following logic, you can either run an Update query or assign the values
through a DAO operation in code.
FirstName: Right$([Name],Len([Name])- InStr(1,[Name],",")-1)
LastName: Left$([Name],InStr(1,[Name],",")-1)
Note: Using similar logic and through the use of Instr, Mid, Left, Right and other
string functions, you can extract any part of a given string.
|