Dim Rs As New ADODB.Recordset
Dim Rst As New ADODB.Recordset
Dim Str As String
Rst.Open "SELECT First(姓名) FROM 表1 GROUP BY 姓名", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
Do While Not Rst.EOF
Rs.Open "select * from 表1 where 姓名='" & Rst.Fields(0) & "'", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
Do While Not Rs.EOF
Str = Str & Rs.Fields("备注")
Rs.MoveNext
Loop
MsgBox Str
Set Rs = Nothing
Rst.MoveNext
Loop
Set Rst = Nothing
[此贴子已经被作者于2006-6-24 22:22:44编辑过]
|