Extracting data from combo box (1 Viewer)

p595659

Registered User.
Local time
Today, 09:05
Joined
Jul 5, 2006
Messages
30
Hi,
I have a combo box, which the first and last name of an employee is combined using trim. Does anybody know of a way to seperate both fields as these would be used an a query so I would need them seen as 2 fields otherwise there won't be any matches.

Cheers,
Ben
 

elbweb

Self Taught Hero
Local time
Today, 03:05
Joined
Jul 28, 2006
Messages
126
if you reverse the logic, you should be fine.

Only time something like this wouldnt work is if there are unnormal names with commas, or whatever you used as the seperation within them.

if thats the case, i would suggest having a hidden column that has the ID of the record or something like that so you can easily refer back to where you got the name

Code:
strName = "Smith, John"
strFirst = Trim(Right(strName, Len(strName) - InStr(strName, ",")))
strLeft = Left(strName, inStr(strName, ",")

that should work, im gonna appologize if it doesn't though cause its a little early for me to be writing code from memory :-/
 

Users who are viewing this thread

Top Bottom