Re: Concatenate problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Ooops...wrong group. I was thinking Access. My bad. Your solution may be
somewhat similar however.

"Steve Schroeder" <sschroeder@xxxxxxxxxxxxx> wrote in message news:...
> Write a function that accepts the ID as an argument, then open a recordset
> using it as the criteria, loop through the records, and concacetenate,
store
> in a string, and update another table with the concacentated string value.
> Here's something I did awhile back:
>
> Function sCostDesc(lcindex As Variant) As Variant
>
> Dim sReturn As Variant
> Dim Db As Database, Rs As Recordset
>
> Set Db = CurrentDb()
> Set Rs = Db.OpenRecordset("Select * From cDescript Where cindex=" &
> lcindex & ";")
>
> Do While Not Rs.EOF
> sReturn = sReturn & " " & Trim(Rs![cddesc])
> Rs.MoveNext
> Loop
>
> sCostDesc = Trim(sReturn)
>
> End Function
>
> "tmwilkin" <tmwilkin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:326046CE-53B4-435A-AF27-1463701E9920@xxxxxxxxxxxxxxxx
> > Hello,
> >
> > I'm working a file with two columns of data. The first column is an ID
> > number, the second is a description keyword. An example is shown below:
> >
> > 388643 WSPHD170440 PE170IP4 417IPEB
> > 388643 LIPE170IP4 IN004PE170IP4
> > 388643 ZZFAB
> > 388643 VVFL
> > 388643 VVNW
> > 766220 IN004!PE110IP5
> > 766220 VVWV
> >
> > I want to concatenate the keywords for each unique ID into one row/cell
> (col
> > B). Can anyone assist? I can work with any function that generates
> > duplicate rows as I could strip them out later.
> >
> > Thanks in advance,
> > Todd
>
>


.



Relevant Pages

  • Re: Problem with the output of Split
    ... to the recordset and made them both advarcharjust to test this. ... The Array and Split statements here seem equivalent except when I try ... Dim varFieldNames As Variant ...
    (microsoft.public.vb.general.discussion)
  • Re: How to determine if object (recordset) is set?
    ... >> Dim rs As New Recordset ... > it would behave differently just because of the New keyword inclusion. ... > placing Dim's within the individual procedures ...
    (microsoft.public.vb.database.ado)
  • RE: import html forms from outlook to access
    ... Dim rstExchange As Recordset, rstUsers As Recordset ... Dim UserName As Variant, UserCompany As Variant ...
    (microsoft.public.access.externaldata)
  • RE: Listbox Sideways
    ... True, but by looping through the fields returned by a recordSet object, ... the array used by the call back function. ... Public Function FillDateBox(ctlField As Control, varID As Variant, varRow As ... Dim varRetval As Variant ...
    (microsoft.public.access.modulesdaovba)
  • Re: sequential numbering in a query
    ... The reason you're not ... getting a higher number is that you're not looping through the recordset: ... Function Generate_NumberAs Variant ... > Dim strSQL As Variant ...
    (microsoft.public.access.gettingstarted)