S
Scott McDaniel
I have a form to enter a First Name Last Name from a keypad on screen.
It works fine to input both First and last name into one field; however
is there a way that when I save the record I can split the first name
and the last name into seperate fields? I know I can enter them
seperatly but I'm trying to do it in one shot. Is there a function that
finds a space between two words, then perhaps another function to enter
whats left of the space, then another to enter whats on the right?
Any help is appreciated
You can use the InStr function to locate a space and then get everything to the Right and Left (using, quite
appropriately, the Right and Left functions) but what happens when someone enters a name like:
John L. Smith
Unless you specifically trap for that scenario, you'd end up storing either John L or L Smith as the First and Last
names. Granted, you could tell your users not to do this, but if you think they'll listen to you then you've got rocks
in your head <g>.
If you have a need to break the data into FirstName and LastName, then the only real foolproof method would be to have
a FirstName and a LastName field, and allow the user to enter those values ... even then, you'll have someone enter a
firstname of "John L.", and some else enter a last name of "L. Smith" ... but at least you can say "Hey, that's the way
the data was entered!".
Thanks
DS
Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com