假设程序运行后单击combo1里的名字,datagrid对应显示记录代码如下:Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\VB\1-数据库相关\adodc\01.mdb;Persist Security Info=False"
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 成绩单"
Set DataGrid1.DataSource = Adodc1
Set Combo1.DataSource = Adodc1
For i = 1 To Adodc1.Recordset.RecordCount
Combo1.AddItem Adodc1.Recordset("姓名").Value
Adodc1.Recordset.MoveNext
Next i
End Sub Private Sub Combo1_click()
Adodc1.RecordSource = "select * from 成绩单 where 姓名='" & Combo1.Text & "'"
Adodc1.Refresh
End Sub 把我代码中的路径和字段名改成你的即可