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

Consolidating several records into a textbox

P: n/a
Hi Every body

I have a query that outputs students names on certain criteria
I want to collect these names in a single textbox in a form(separated
by space or dash)
the number of records varied each time.

what can I do to achieve that

Thanks very much for your help

Nov 14 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
"NoviceProgramer" <hg*******@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Hi Every body

I have a query that outputs students names on certain criteria
I want to collect these names in a single textbox in a form(separated
by space or dash)
the number of records varied each time.

what can I do to achieve that

Thanks very much for your help
In your query have a calculated field based on your stored data:

FullName: [FirstName] & " " & [Surname]

Then bind your text box to FullName.

Regards,
Keith.
www.keithwilby.com
Nov 14 '06 #2

P: n/a
Thank you Keith for your reply, but actually I want to gather the
Family Names of my students to a single textbox ie if the query outputs
four students, then the textbox should contains:
"Student01, Student02, Student03, and Student04."

any sugestions about how to do this?

Dr. Ennesr

Keith Wilby wrote:
"NoviceProgramer" <hg*******@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Hi Every body

I have a query that outputs students names on certain criteria
I want to collect these names in a single textbox in a form(separated
by space or dash)
the number of records varied each time.

what can I do to achieve that

Thanks very much for your help

In your query have a calculated field based on your stored data:

FullName: [FirstName] & " " & [Surname]

Then bind your text box to FullName.

Regards,
Keith.
www.keithwilby.com
Nov 14 '06 #3

P: n/a
"NoviceProgramer" <hg*******@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Thank you Keith for your reply, but actually I want to gather the
Family Names of my students to a single textbox ie if the query outputs
four students, then the textbox should contains:
"Student01, Student02, Student03, and Student04."

any sugestions about how to do this?
I think you'd need to write some code to loop through the records to
concatenate a field like that, unless someone else can jump in and suggest
something ... I don't think there's anything out of the box that will do it
for you.

Keith.
Nov 14 '06 #4

P: n/a
"Keith Wilby" <he**@there.comwrote in message
news:45**********@glkas0286.greenlnk.net...
"NoviceProgramer" <hg*******@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>Thank you Keith for your reply, but actually I want to gather the
Family Names of my students to a single textbox ie if the query outputs
four students, then the textbox should contains:
"Student01, Student02, Student03, and Student04."

any sugestions about how to do this?

I think you'd need to write some code to loop through the records to
concatenate a field like that, unless someone else can jump in and suggest
something ... I don't think there's anything out of the box that will do
it for you.

Keith.
Here's some code I used to concatenate a field called DES_AREA, you might be
able to adapt it:

Public Function libDA(strID As String) As String

Dim db As Database, rs As Recordset, strSQL As String
Set db = CurrentDb

strSQL = "Select [DES_AREA] from tblMyTable where [fldID] = " & strID & ";"

Set rs = db.OpenRecordset(strSQL)
With rs
If .EOF Then Exit Function
Do Until .EOF
libDA = libDA & ![DES_AREA] & ", "
.MoveNext
Loop
End With

libDA = Left(libDA, Len(libDA) - 2)

End Function
Nov 14 '06 #5

P: n/a
"Keith Wilby" <he**@there.comwrote in
news:45**********@glkas0286.greenlnk.net:
"NoviceProgramer" <hg*******@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>Thank you Keith for your reply, but actually I want to gather
the Family Names of my students to a single textbox ie if the
query outputs four students, then the textbox should
contains: "Student01, Student02, Student03, and Student04."

any sugestions about how to do this?

I think you'd need to write some code to loop through the
records to concatenate a field like that, unless someone else
can jump in and suggest something ... I don't think there's
anything out of the box that will do it for you.

Keith.
Just use the function fConcatChild at
www.mvps.org/access/modules/mdl0004.htm

It's as close to out of the box as you would want

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Nov 15 '06 #6

P: n/a
Thank you very much Keith for your help

On Nov 15, 3:59 am, Bob Quintal <rquin...@sPAmpatico.cawrote:
"Keith Wilby" <h...@there.comwrote innews:45**********@glkas0286.greenlnk.net:
"NoviceProgramer" <hgnov3...@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Thank you Keith for your reply, but actually I want to gather
the Family Names of my students to a single textbox ie if the
query outputs four students, then the textbox should
contains: "Student01, Student02, Student03, and Student04."
any sugestions about how to do this?
I think you'd need to write some code to loop through the
records to concatenate a field like that, unless someone else
can jump in and suggest something ... I don't think there's
anything out of the box that will do it for you.
Keith.Just use the function fConcatChild atwww.mvps.org/access/modules/mdl0004.htm

It's as close to out of the box as you would want

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account fromhttp://www.teranews.com
Nov 15 '06 #7

P: n/a
Thank you very much Bob for you help
Bob Quintal wrote:
"Keith Wilby" <he**@there.comwrote in
news:45**********@glkas0286.greenlnk.net:
"NoviceProgramer" <hg*******@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Thank you Keith for your reply, but actually I want to gather
the Family Names of my students to a single textbox ie if the
query outputs four students, then the textbox should
contains: "Student01, Student02, Student03, and Student04."

any sugestions about how to do this?
I think you'd need to write some code to loop through the
records to concatenate a field like that, unless someone else
can jump in and suggest something ... I don't think there's
anything out of the box that will do it for you.

Keith.

Just use the function fConcatChild at
www.mvps.org/access/modules/mdl0004.htm

It's as close to out of the box as you would want

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com
Nov 15 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.