Question : How do I combine into one record, fields with identical key in Access 07?

I have the task of taking and Access 07 database that has data in which I need to combine records with the same Key field (Parcel_ID).  Example below:
Resources_Parcel_Legal (Table)
Before:
Parcel_ID    Plat_Book     Page      Deed_Date      Legal_Description
10                  1834           361         1/12/99             PT NW SW
10                  0322         0233         9/22/95             MH ON LEASE
                                                                                      RPID55
10                  0344            541         2/22/93            PT NW SW

After:
Parcel_ID       Plat_Book     Page      Deed_Date      Legal_Description
 10                    1834               36         1/12/99               PT NW SW
                                                                                            MH ON LEASE
                                                                                            RPID55

So I need VB code or script to take the identical Parcel_ID field and combine the Legal_Description fields and create one record from the three.  I need the code
to update the database and remove the two records that are combined.

If anyone can help me with this I would be very grateful!

Answer : How do I combine into one record, fields with identical key in Access 07?

Hope this should work
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
Public Function Concat(ParcelID As String) As String 
 
Dim rs As DAO.Recordset 
Dim strTopic As String 
Dim StrSQL As String 
  
StrSQL = "SELECT DISTINCT [Legal_Description] FROM Resources_Parcel_Legal WHERE Parcel_ID='" & ParcelID & "'" 
 
Set rs = CurrentDb.OpenRecordset(StrSQL) 
  
rs.MoveFirst 
  
Do Until rs.EOF 
    strTopic = strTopic & rs![Legal_Description] & ", " 
    rs.MoveNext 
Loop 
  
If Len(strTopic & "") > 0 Then 
    strTopic = Left(strTopic, Len(strTopic) - 2) 
Else 
   strTopic = "" 
End If 
  
Concat = strTopic 
  
End Function
Random Solutions  
 
programming4us programming4us