Dim nm() As String = {"采购进货","销售明细","入库明细"}
Dim nm1() As String = {"采购订单","销售订单","采购入库"}
Dim fdr As DataRow
For i As Integer = 0 To nm.Length-1
fdr = DataTables(nm(i)).Find("定额编码 = '" & e.DataRow("定额编码") & "' ")
If fdr IsNot Nothing Then
Dim result As DialogResult = MessageBox.Show("此材料已被:'"& nm(i) &"' 录入,是否删除对应采购进货明细后再删除本条材料?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question)
If result = dialogresult.no Then
e.Cancel = True
Else
e.Cancel = True
Forms(nm1(i)).show
End If
Exit For
End If
Next
If fdr Is Nothing Then
If MessageBox.Show("是否删除本条机具?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.yes Then
Else
e.Cancel = True
End If
End If