Connecting Tech Pros Worldwide Help | Site Map

Consolidating several records into a textbox

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 14th, 2006, 06:55 AM
NoviceProgramer
Guest
 
Posts: n/a
Default Consolidating several records into a textbox

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


  #2  
Old November 14th, 2006, 07:35 AM
Keith Wilby
Guest
 
Posts: n/a
Default 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


  #3  
Old November 14th, 2006, 10:15 AM
NoviceProgramer
Guest
 
Posts: n/a
Default 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
  #4  
Old November 14th, 2006, 10:25 AM
Keith Wilby
Guest
 
Posts: n/a
Default 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.


  #5  
Old November 14th, 2006, 10:35 AM
Keith Wilby
Guest
 
Posts: n/a
Default 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


  #6  
Old November 15th, 2006, 01:35 AM
Bob Quintal
Guest
 
Posts: n/a
Default 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

  #7  
Old November 15th, 2006, 06:45 AM
NoviceProgramer
Guest
 
Posts: n/a
Default 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
  #8  
Old November 15th, 2006, 06:45 AM
NoviceProgramer
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.