此主题相关图片如下:qq截图20131226162505.png
If Tables("fssr1").Current.DataRow.Rowstate = DataRowState.Added Then
Dim bh As WinForm.ComboBox = e.Form.Controls("ComboBox2") '编号
Dim r1 As DataRow = DataTables("pjrk").Find("piao据号 ='" & bh.value & "'")
If r1 IsNot Nothing
r1("已开否") = True
r1("开具单位") = e.Form.Controls("ComboBox1").value
DataTables("pjrk").save
End If
ElseIf Tables("fssr1").Current.DataRow.RowState <> DataRowState.Unchanged '如果是当前行是修改的
If Tables("fssr1").Current("编号") <> Vars("djbh") '将原编号释放
If MessageBox.Show("单据编号已经改变,是否释放原来编号:" & Vars("djbh") ) =6
Dim r2 As DataRow = DataTables("pjrk").Find("piao据号 ='" & Vars("djbh") & "'")
If r2 IsNot Nothing Then
r2("已开否") = False
r2("开具单位") = ""
End If
Dim r3 As DataRow = DataTables("pjrk").Find("piao据号 ='" & bh.value & "'")
If r3 IsNot Nothing
r3("已开否") = True
r3("开具单位") = e.Form.Controls("ComboBox1").value
DataTables("pjrk").save
End If
Else '如果和原来 的一样 说明 本次 没有修改编号
Dim r4 As DataRow = DataTables("pjrk").Find("piao据号 ='" & bh.value & "'")
If r4 IsNot Nothing
r4("已开否") = True
r4("开具单位") = e.Form.Controls("ComboBox1").value
DataTables("pjrk").save
End If
End If
Else
Dim r5 As DataRow = DataTables("pjrk").Find("piao据号 ='" & bh.value & "'")
If r5 IsNot Nothing
r5("已开否") = True
r5("开具单位") = e.Form.Controls("ComboBox1").value
DataTables("pjrk").save
End If
End If
End If