Connecting Tech Pros Worldwide Forums | Help | Site Map

Consolidating several records into a textbox

NoviceProgramer
Guest
 
Posts: n/a
#1: Nov 14 '06
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


Keith Wilby
Guest
 
Posts: n/a
#2: Nov 14 '06

re: Consolidating several records into a textbox


"NoviceProgramer" <hgnov3000@gmail.comwrote in message
news:1163491871.403992.106090@i42g2000cwa.googlegr oups.com...
Quote:
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


NoviceProgramer
Guest
 
Posts: n/a
#3: Nov 14 '06

re: Consolidating several records into a textbox


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:
Quote:
"NoviceProgramer" <hgnov3000@gmail.comwrote in message
news:1163491871.403992.106090@i42g2000cwa.googlegr oups.com...
Quote:
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
Keith Wilby
Guest
 
Posts: n/a
#4: Nov 14 '06

re: Consolidating several records into a textbox


"NoviceProgramer" <hgnov3000@gmail.comwrote in message
news:1163503912.144038.231830@b28g2000cwb.googlegr oups.com...
Quote:
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.


Keith Wilby
Guest
 
Posts: n/a
#5: Nov 14 '06

re: Consolidating several records into a textbox


"Keith Wilby" <here@there.comwrote in message
news:4559a949$1_1@glkas0286.greenlnk.net...
Quote:
"NoviceProgramer" <hgnov3000@gmail.comwrote in message
news:1163503912.144038.231830@b28g2000cwb.googlegr oups.com...
Quote:
>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


Bob Quintal
Guest
 
Posts: n/a
#6: Nov 15 '06

re: Consolidating several records into a textbox


"Keith Wilby" <here@there.comwrote in
news:4559a949$1_1@glkas0286.greenlnk.net:
Quote:
"NoviceProgramer" <hgnov3000@gmail.comwrote in message
news:1163503912.144038.231830@b28g2000cwb.googlegr oups.com...
Quote:
>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

NoviceProgramer
Guest
 
Posts: n/a
#7: Nov 15 '06

re: Consolidating several records into a textbox


Thank you very much Keith for your help

On Nov 15, 3:59 am, Bob Quintal <rquin...@sPAmpatico.cawrote:
Quote:
"Keith Wilby" <h...@there.comwrote innews:4559a949$1_1@glkas0286.greenlnk.net:
>
>
>
Quote:
"NoviceProgramer" <hgnov3...@gmail.comwrote in message
news:1163503912.144038.231830@b28g2000cwb.googlegr oups.com...
Quote:
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."
>
Quote:
Quote:
any sugestions about how to do this?
>
Quote:
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.
>
Quote:
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
NoviceProgramer
Guest
 
Posts: n/a
#8: Nov 15 '06

re: Consolidating several records into a textbox


Thank you very much Bob for you help


Bob Quintal wrote:
Quote:
"Keith Wilby" <here@there.comwrote in
news:4559a949$1_1@glkas0286.greenlnk.net:
>
Quote:
"NoviceProgramer" <hgnov3000@gmail.comwrote in message
news:1163503912.144038.231830@b28g2000cwb.googlegr oups.com...
Quote:
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
Closed Thread