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

Extracting people from a list

P: n/a
I have a text box on a form. In that text box is a list of people separated
by a comma. Like A.Smith, L.Jones, P.Somebody, H. Somebodyelse Note, there
is no full stop at the end of the list which is all on one horizontal line.

I need to be able to extract each person in that list and set a field true
for them.

If the textbox is called txtPeople and the field I wish to set = -1 is
called fldTag, is there some simple code I can run from an event to do this?

TIA
dixie
Nov 13 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Look at the Split() Function in the VB Editor Help. This will give you the
people in the list, with which to work.

Jim Evans

"dixie" <di***@dogmail.com> wrote in message
news:42********@duster.adelaide.on.net...
I have a text box on a form. In that text box is a list of people separated by a comma. Like A.Smith, L.Jones, P.Somebody, H. Somebodyelse Note, there is no full stop at the end of the list which is all on one horizontal line.
I need to be able to extract each person in that list and set a field true
for them.

If the textbox is called txtPeople and the field I wish to set = -1 is
called fldTag, is there some simple code I can run from an event to do this?
TIA
dixie

Nov 13 '05 #2

P: n/a
You don't really mention what you want to do with the names.

You could place a buttion on your form, and when clicked, it would show each
name. The code would look like:

Dim vList As Variant
Dim i As Integer

vList = Split(me!txtPeople, ",")

For i = 0 To UBound(vList)

Debug.Print vList(i)

Next i

End Sub

The above would extract all names one by one from the txtbox. It is not
clear how/when you want to set the fldTag field? Do you have more then one
fldTag?
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.members.shaw.ca/AlbertKallal
Nov 13 '05 #3

P: n/a
It is a list of supervisors accompanying a group. Say I wish to edit the
list and add one more supervisor. All supervisors names for the entry are
stored in a single field and they were added to that field basically by
setting a True/False field (fldTag) to true and having each one of them
appended to the list with a comma-space delimiting them.. After they are in
the collective field, the true false tag is reset to false. Now, if I wish
to later add a supervisor to the existing list, I click their name in a
combo box, their tag is set and they replace the multiple names already in
the field. What I was aiming to do was at the same time as selecting the
new supervisor, have the names in the list in the text box also have their
tag set to true. This should ensure all the supervisors, including the
existing ones and the new one(s) will be placed in the List field. So,
answering your questions, the fldTag field should be set for all people in
the list as an after update event from clicking the new person in a
supervisor combo box, and there is only one fldTag.

I'm afraid explaining things is not my forte. Does that make sense?

dixie

"Albert D. Kallal" <ka****@msn.com> wrote in message
news:T2kRd.420683$8l.348553@pd7tw1no...
You don't really mention what you want to do with the names.

You could place a buttion on your form, and when clicked, it would show
each name. The code would look like:

Dim vList As Variant
Dim i As Integer

vList = Split(me!txtPeople, ",")

For i = 0 To UBound(vList)

Debug.Print vList(i)

Next i

End Sub

The above would extract all names one by one from the txtbox. It is not
clear how/when you want to set the fldTag field? Do you have more then one
fldTag?
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.members.shaw.ca/AlbertKallal

Nov 13 '05 #4

P: n/a
OK, I am at the stage where I can click a button and get a list of the
supervisors in the immediate window, but what I want to do with this Split
is simply to set a boolean field for each one to true. I can't seem to make
the connection between getting a list of names in the immediate window and
doing this?

dixie

"dixie" <di***@dogmail.com> wrote in message
news:42********@duster.adelaide.on.net...
It is a list of supervisors accompanying a group. Say I wish to edit the
list and add one more supervisor. All supervisors names for the entry are
stored in a single field and they were added to that field basically by
setting a True/False field (fldTag) to true and having each one of them
appended to the list with a comma-space delimiting them.. After they are
in the collective field, the true false tag is reset to false. Now, if I
wish to later add a supervisor to the existing list, I click their name in
a combo box, their tag is set and they replace the multiple names already
in the field. What I was aiming to do was at the same time as selecting
the new supervisor, have the names in the list in the text box also have
their tag set to true. This should ensure all the supervisors, including
the existing ones and the new one(s) will be placed in the List field.
So, answering your questions, the fldTag field should be set for all
people in the list as an after update event from clicking the new person
in a supervisor combo box, and there is only one fldTag.

I'm afraid explaining things is not my forte. Does that make sense?

dixie

"Albert D. Kallal" <ka****@msn.com> wrote in message
news:T2kRd.420683$8l.348553@pd7tw1no...
You don't really mention what you want to do with the names.

You could place a buttion on your form, and when clicked, it would show
each name. The code would look like:

Dim vList As Variant
Dim i As Integer

vList = Split(me!txtPeople, ",")

For i = 0 To UBound(vList)

Debug.Print vList(i)

Next i

End Sub

The above would extract all names one by one from the txtbox. It is not
clear how/when you want to set the fldTag field? Do you have more then
one fldTag?
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.members.shaw.ca/AlbertKallal


Nov 13 '05 #5

P: n/a
OK, I am at the stage where I can click a button and get a list of the
supervisors in the immediate window, but what I want to do with this Split
is simply to set a boolean field for each one to true. I can't seem to make
the connection between getting a list of names in the immediate window and
doing this?

dixie

"dixie" <di***@dogmail.com> wrote in message
news:42********@duster.adelaide.on.net...
It is a list of supervisors accompanying a group. Say I wish to edit the
list and add one more supervisor. All supervisors names for the entry are
stored in a single field and they were added to that field basically by
setting a True/False field (fldTag) to true and having each one of them
appended to the list with a comma-space delimiting them.. After they are
in the collective field, the true false tag is reset to false. Now, if I
wish to later add a supervisor to the existing list, I click their name in
a combo box, their tag is set and they replace the multiple names already
in the field. What I was aiming to do was at the same time as selecting
the new supervisor, have the names in the list in the text box also have
their tag set to true. This should ensure all the supervisors, including
the existing ones and the new one(s) will be placed in the List field.
So, answering your questions, the fldTag field should be set for all
people in the list as an after update event from clicking the new person
in a supervisor combo box, and there is only one fldTag.

I'm afraid explaining things is not my forte. Does that make sense?

dixie

"Albert D. Kallal" <ka****@msn.com> wrote in message
news:T2kRd.420683$8l.348553@pd7tw1no...
You don't really mention what you want to do with the names.

You could place a buttion on your form, and when clicked, it would show
each name. The code would look like:

Dim vList As Variant
Dim i As Integer

vList = Split(me!txtPeople, ",")

For i = 0 To UBound(vList)

Debug.Print vList(i)

Next i

End Sub

The above would extract all names one by one from the txtbox. It is not
clear how/when you want to set the fldTag field? Do you have more then
one fldTag?
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.members.shaw.ca/AlbertKallal


Nov 13 '05 #6

P: n/a
dixie wrote:
OK, I am at the stage where I can click a button and get a list of the supervisors in the immediate window, but what I want to do with this Split is simply to set a boolean field for each one to true. I can't seem to make the connection between getting a list of names in the immediate window and doing this?

dixie


Hi Dixie,

Here are some key words that may prove useful: RecordsetClone (before
loop), FindFirst, NoMatch, Edit, Update, Refresh (after loop). I think
Albert just used Debug.Print to show you that the names are available
in vList(i). I would also consider the possibility of using a separate
table to hold the list of supervisors accompanying the groups. It
might be simpler to implement, or not.

James A. Fortune

Chumps can sit ... We'll stand up.
-- Malcolm X

Nov 13 '05 #7

P: n/a
dixie wrote:
OK, I am at the stage where I can click a button and get a list of the supervisors in the immediate window, but what I want to do with this Split is simply to set a boolean field for each one to true. I can't seem to make the connection between getting a list of names in the immediate window and doing this?

dixie


Hi Dixie,

Here are some key words that may prove useful: RecordsetClone (before
loop), FindFirst, NoMatch, Edit, Update, Refresh (after loop). I think
Albert just used Debug.Print to show you that the names are available
in vList(i). I would also consider the possibility of using a separate
table to hold the list of supervisors accompanying the groups. It
might be simpler to implement, or not.

James A. Fortune

Chumps can sit ... We'll stand up.
-- Malcolm X

Nov 13 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.