删除List1行来源,使用以下代码即可:
Private Sub List1_AfterUpdate()
Dim d As Recordset
Dim strSQL As String
Dim strName As String
Me.RecordSource = " SELECT * FROM 表1 WHERE (((表1.编号)=[Forms]![窗体]![List1]));"
Me.child1.Form.RecordSource = "SELECT * FROM 结果1 WHERE (((IsNull(结果1.结果))=False)); "
Me.Requery
strSQL = "SELECT DISTINCT * FROM 表1 "
strSQL = strSQL & "WHERE 编号='" & Me.List1 & "';"
Set d = CurrentDb.OpenRecordset(strSQL)
If Not d.EOF Then
d.MoveFirst
Do While Not d.EOF
strName = strName & d("姓名") & ","
d.MoveNext
Loop
Me.Text8 = Left(strName, Len(strName) - 1)
End If
d.Close
End Sub
[此贴子已经被作者于2006-5-16 23:01:39编辑过]
|