changing name format (1 Viewer)

littlej

Registered User.
Local time
Today, 09:20
Joined
Jun 21, 2000
Messages
23
Does anybody know how to change the following text using code....

John Doe to Doe,John
 

Atomic Shrimp

Humanoid lifeform
Local time
Today, 09:20
Joined
Jun 16, 2000
Messages
1,954
Yes, should be something like:

NewString = mid(OldString, (instr(OldString," "))+1, ((Len(OldString))-(instr(OldString," ")))-1) & "," & " left(OldString, (instr(OldString," "))-1)

can be done with less repetition if you want it in code, rather than a single line expression as above.

I should also warn that I'm doing this in my head as I'm posting this from a PC without Access on it, so I can't test it at the mo.

Mike
 

Atomic Shrimp

Humanoid lifeform
Local time
Today, 09:20
Joined
Jun 16, 2000
Messages
1,954
...but, It won't work if youve got multiple first names in your table like 'John Boy Walton', it will get confused and change it to: 'Boy Walton,John'

but multiple or hyphenated surnames 'Tara Palmer Tomkinson' or 'Tara Palmer-Tomkinson' will work

Mike
 

Users who are viewing this thread

Top Bottom