通过副表的删除进而删除主表的内容。
代码如下:
Tables("合同信息表").AllowEdit = True
Dim dr As DataRow
dr = Tables("合同主窗口_Table1").current.DataRow
If dr IsNot Nothing Then
Dim wz As Integer = Tables("合同信息表").FindRow(dr)
If wz >= 0 Then
Tables("合同信息表").Position = wz
Dim vr As DataRow = Tables("合同信息表").current.DataRow
Dim Result As DialogResult
Result = MessageBox.Show("您确定要删除吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
dr.Delete
vr.Delete
End If
End If
End If
问题如题所示。