代码如下
Dim lx As String = e.Form.Controls("类型").value
Dim rq As WinForm.DateTimePicker = e.Form.Controls("日期")
Dim je As WinForm.NumericComboBox = e.Form.Controls("金额")
Dim hk As WinForm.DateTimePicker = e.Form.Controls("回款日期")
Dim kh As WinForm.ComboBox = e.Form.Controls("客户")
Dim gy As WinForm.ComboBox = e.Form.Controls("供应商")
If Tables("应收应付").Current IsNot Nothing Then
Tables("应收应付").Current.Save()
End If
If lx = "增加开piao" Then
If lx = False Or rq.Value = False Or je.Value = False Or hk.Value = False Or kh.Value = False Then
MessageBox.Show("请完善信息!")
Else
Dim dr As DataRow = DataTables("应收应付").AddNew()
dr("类型") = lx
dr("单位") = kh.Value
dr("日期") = rq.Value
dr("应收增加") = je.Value
dr("回款日期") = hk.Value
End If
End If
Tables("应收应付").Sort = "日期 DESC"
[此贴子已经被作者于2018/8/7 15:12:09编辑过]