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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field format 1

Status
Not open for further replies.

Oz1127

Technical User
Oct 12, 2004
19
US
I have a field within a table like the following: Doe,John. Can someone help me with an expression that would switch it around? Like, John Doe. I'm getting everything but the result I want. Thanks in advance for the help.
 
Try this:
Trim(right(Name, Len(Name) - InStr(Name, ","))) & " " & Trim(left(Name, InStr(Name, ",") - 1))

 
Another way:
Dim a
a = Array()
a = Split(Name, ",")
The Result = trim(a(1)) & " " & Trim(a(0))
 
Yet another way:
Trim(Mid([Name field],1+InStr([Name field],","))) & " " & Left([Name field],InStr([Name field],",")-1)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks Gyz, Is it also possible to use modules in Access and do the following?

Function ReverseString (MyString As String)
ReverseString = StrReverse(MyString)
End Function


I didn't have to much luck with it it, just wanna know if there is another way of doing it.Trying to learn, ya know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top