By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,905 Members | 2,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,905 IT Pros & Developers. It's quick & easy.

Left Function - Finding the gap

P: 31
Morning all,

Wondering if anyone can help me out with this one?

I have a "Add User" form to add a new users information tel, mob etc.

One field is the persons full name. What I am trying to do is extract the persons first name into a seperate field.

i.e. FullName = "Bob Almighty"
ShortName = "Bob"

I know you can use the Left Function to cut down a string depending on the value you enter, what I am struggling with is trying to find a way for access to recognise where the gap between the words.

Is this possible or is this beond the power of VBA?

Cheers for any help!
Jan 8 '07 #1
Share this Question
Share on Google+
3 Replies


hariharanmca
100+
P: 1,977
Morning all,

Wondering if anyone can help me out with this one?

I have a "Add User" form to add a new users information tel, mob etc.

One field is the persons full name. What I am trying to do is extract the persons first name into a seperate field.

i.e. FullName = "Bob Almighty"
ShortName = "Bob"

I know you can use the Left Function to cut down a string depending on the value you enter, what I am struggling with is trying to find a way for access to recognise where the gap between the words.

Is this possible or is this beond the power of VBA?

Cheers for any help!


Yes you can use
Dim noName as integer
Dim Name() as string
noName=ubound(split(txtname.text, ))
redim name(noName) as string
Name = split(txtname.text, )
Jan 8 '07 #2

hariharanmca
100+
P: 1,977
Morning all,

Wondering if anyone can help me out with this one?

I have a "Add User" form to add a new users information tel, mob etc.

One field is the persons full name. What I am trying to do is extract the persons first name into a seperate field.

i.e. FullName = "Bob Almighty"
ShortName = "Bob"

I know you can use the Left Function to cut down a string depending on the value you enter, what I am struggling with is trying to find a way for access to recognise where the gap between the words.

Is this possible or is this beond the power of VBA?

Cheers for any help!


In split() the name will be splited into array then you can use it
Jan 8 '07 #3

P: 31
Fantastic!!

Worked a treat. This is what drives me mad the most about VBA, the biggest headaches are usually solved with a simple command that you didn't know about.

Cheers
Jan 8 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.