<span style="font-family:SimHei;font-size:24px;">Private Sub DataList1_Click() Dim strQuery As String strQuery = "SELECT*FROM ygyj WHERE 业绩名称='" & DataList1.BoundText & "'" With AdoDataSource .RecordSource = strQuery .Refresh End With With DataGrid1 .ClearFields .ReBind End With End Sub</span>
1.将图中个控件加载的窗体上,在这之前你可以利用vb可视化数据管理器完成如下数据库表格
2.将Adodc1和Adodc2的名称和caption属性分别都改为AdoDataSource和AdoRowSource
3.右键单击AdoDataSource控件选择ADOCO属性
4.对AdoRowSource的操作同上在记录源处稍有不同
5.修改DataList1的属性Rowsource为AdoRowSource ListField,DataField BoundColumbia属性为业绩名称
6.修改DataGrid的属性AllowAddNew,AllowArrows,AllowDelete,AllowUpdata,Appearance属性均为true
4.对AdoRowSource的操作同上在记录源处稍有不同
5.修改DataList1的属性Rowsource为AdoRowSource listField,DataField BoundColumbia属性为业绩名称
6.修改DataGrid的属性AllowAddNew,Appearance属性均为true