kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
I have a form on which I have first name, Middle name and last name.
Then I have one textbox labeled "full name" . Which takes the combination of the names in the three textboxes.
So now, I want to split those names from the full name textbox back into their original textboxes.
The only foreign characters will be a space , a hyphen or a dot
These are the conditions :
1. A name like "nice-name" should be treated as a single word.
2. A name like "nice name" should be treated as two words.
3. A name like "A. nice name" should be treated as three words.
4. If the number of words is only two, then place the first word into first name textbox and second word into last name textbox.
5. If more than two words, then place first word into first name textbox, place last word (first from right) into the last name textbox and the remaining words into the middle name textbox.
I have tried something but seems to take me somewhere else.
I was using this to split two words but the last line failed.
I know I am doing something wrongly however my skills are limited to fix it.
I needed some powerful brains fix it for me.
Thanks
Then I have one textbox labeled "full name" . Which takes the combination of the names in the three textboxes.
So now, I want to split those names from the full name textbox back into their original textboxes.
The only foreign characters will be a space , a hyphen or a dot
These are the conditions :
1. A name like "nice-name" should be treated as a single word.
2. A name like "nice name" should be treated as two words.
3. A name like "A. nice name" should be treated as three words.
4. If the number of words is only two, then place the first word into first name textbox and second word into last name textbox.
5. If more than two words, then place first word into first name textbox, place last word (first from right) into the last name textbox and the remaining words into the middle name textbox.
I have tried something but seems to take me somewhere else.
I was using this to split two words but the last line failed.
Code:
Private Sub d_Click ()
a[COLOR=#333333]= Split (d.Text, " ")(0)
[/COLOR]b[COLOR=#333333]= Split (d.Text, " ")(1)[/COLOR][COLOR=#333333]
[/COLOR]End Sub
I know I am doing something wrongly however my skills are limited to fix it.
I needed some powerful brains fix it for me.
Thanks