Parse Names (1 Viewer)

QueryStumped

Registered User.
Local time
Today, 18:29
Joined
Mar 22, 2017
Messages
60
Hello, this is QueryStumped from KY. Avid Access user, love it. Not a programmer, but able to create and maintain databases, queries, reports, and macros. Recently stumped on a request, visited several websites/blogs. Need to parse name field. Comes in as LName,FName MI. I need Last Name and First Name. Please advise.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:29
Joined
Feb 19, 2013
Messages
16,618
basic need is to use the left, mid and instr functions

LName=left(fldname,instr(fldname,",")-1)
FName=left(mid(fldname,instr(fldname,",")+1),instr(mid(fldname,instr(fldname,",")+1)," ")-1)
 

MarkK

bit cruncher
Local time
Today, 15:29
Joined
Mar 17, 2004
Messages
8,181
Also...
Code:
dim var1
dim var2
var1 = Split(fldname, ",")
LName = var1(0)
var2 = Split(var(1))
FName = var2(0)
MI = var2(1)
 

QueryStumped

Registered User.
Local time
Today, 18:29
Joined
Mar 22, 2017
Messages
60
Thank you, I will try when I get in the office. Appreciate the help, immensely!!
 

QueryStumped

Registered User.
Local time
Today, 18:29
Joined
Mar 22, 2017
Messages
60
Thank you...I will look at the code too. But I am not well verse in code, as much as, putting the formula within the query itself. But will still look at it. Appreciate all the help. Will let you all know what happens.
 

Users who are viewing this thread

Top Bottom