如果有关联的话,可以看看:
http://www.foxtable.com/help/topics/2238.htm
没有关联的话,就先用Find判断一下:
If DataTables("订单明细").Find("订单编号 = '" & e.DataRow("订单编号") & "'") IsNot Nothing Then
Dim s As String = "此订单存在订单明细, 是否确定要删除此订单及其订单明细?"
If MessageBox.Show(s,"提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.No
e.Cancel= True
End If
End If