Please help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

1.Sorry for my poor english
2.I have table with example rows:
Person ID_of_something
John Brown fg763jk87
John Brown wi98hj45jk
John Brown lmn56hj45
Mary Halloway 456FGH123
Mary Halloway 095jd34nmf

and I need have this as a result of query like this:
Person ID's list
John Brown fg763jk87; wi98hj45jk; lmn56hj45
Mary Holloway 456FGH123; 095jd34nmf

Please help, how can I do this?
 
Create an temp table, and create a function to insert the data into the temp
table, and then open the table
======================================
Temp Table: Name - "TempTable"
Fields - Person , ID_of_something (both the same
structure as the original table
======================================
Function:
Function FunctionName()
Dim MyDb As Dao.DataBase, MyRec As Dao.RecordSet, MyPerson As String,
MyRecTemp As Dao.RecordSet, MyId As String

Docmd.RunSql "DELETE TempTable.* FROM TempTable"

Set MyDb = CurrentDb
Set MyRecTemp = MyDb.OpenRecordSet("Select * From TempTable")
Set MyRec = MyDb.OpenRecordSet("Select * From OrigTableName Order By Person")
MyName = ""
While not MyRec.Eof
If MyName = MyRec!Person Then
MyId = MyId & ";" & MyRec!ID_of_something
Else
If MyName <> "" Then
MyRecTemp.AddNew
MyRecTemp!Person = MyName
MyRecTemp!ID_of_something = MyId
MyRecTemp.Update
End If
MyName = MyRec!Person
MyId = MyRec!ID_of_something
End If
MyRec.MoveNext
Wend
docmd.OpenTable "TempTable"
End Function
=======================================
I didn't try this code, it should give you an example, and mybe a starting
point
Good luck
 
Wow
thanks a lot. You're GREAT!!!
I'll try with this.
--
Greetings
Marchos


„Ofer†:
 
OFER YOU'RE GREAT!!!
Thanks a lot.
It works perfectly!!!!
--
Greetings
Marchos


„Ofer†pisze:
 
Back
Top