For Each dr As DataRow In DataTables("产品").Select("型号 = '" & Tables("父表").current("型号") & "'") Dim fdr As DataRow = DataTables("子表").find("编号 = '" & Tables("父表").current("编号") & "' and 品名 = '" & dr("品名") & "'") If fdr Is Nothing Then Dim ndr As DataRow = DataTables("子表").addnew ndr("编号") = Tables("父表").current("编号") ndr("品名") = dr("品名") End If Next