G Guest Feb 9, 2007 #1 Hi, If i have a string, a name, "James taylor" how do I use trim to extract the first name "James"
J John Spencer Feb 9, 2007 #2 The expression below will work as long as the string has a space in it. Trim(Left([TheString],Instr(1,[TheString]," "))) If your string might be blank (or null) or have no space in it, try Trim(Left([TheString],Instr(1,[TheString] & " "," "))) -- John Spencer Access MVP 2002-2005, 2007 Center for Health Program Development and Management University of Maryland Baltimore County ..
The expression below will work as long as the string has a space in it. Trim(Left([TheString],Instr(1,[TheString]," "))) If your string might be blank (or null) or have no space in it, try Trim(Left([TheString],Instr(1,[TheString] & " "," "))) -- John Spencer Access MVP 2002-2005, 2007 Center for Health Program Development and Management University of Maryland Baltimore County ..