Ò»¸ö´°Ì壬3¸ödatagrid£¬¹²¼Æ3¸ö±í£¬Ò»¸ö±í¶ÔÓ¦Ò»¸ödatagrid£¬µã»÷datagrid1(´ò¿ª¸Ã´°ÌåʱÒѾ±»¸³Öµ)£¬¸ù¾Ýdatagrid1ÖеÄij¸öÖµ£¬²éѯ±í2ºÍ±í3£¬²¢°Ñ·ûºÏÌõ¼þµÄ·Ö±ð¸³Öµ¸ødatagrid2ºÍdatagrid3£¬ÒªÔõôд VB code: Private Sub DataGrid1_Click() 'ÔÚ´Ë´¦Ð´SQL²éѯÓï¾ä»ñµÃ¼Ç¼¼¯,²¢°ó¶¨¸Ã¼Ç¼¼¯µ½ÁíÍâµÄDataGrid¿Ø¼þ End Sub
ÎÒÖªµÀÕâÑùд£¬¿ÉÊDzéѯÓï¾äºÍÁ¬½ÓÊý¾Ý¿â¾³£´íÎ󣬲»ÖªµÀÄÇÀï´íÁË VB code: Private Sub DataGrid1_Click() DataGrid2.Visible = False Adodc2.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=jwl_dbf" Adodc2.RecordSource = "select * from JWCK_BM" & " where ±¸¼þ´úÂë ='" & Adodc1.Recordset(2) & "'" Adodc2.Refresh Text1.SetFocus DataGrid2.Visible = True End Sub