在客户表BeforeDeleteDataRow事件中
Dim q As DataRow = DataTables("订单表").Find("[客户] = '" & e.DataRow("客户") & "'")If q IsNot Nothing Then
e.Cancel = TrueEnd If