Dim sts As String() = {"入库单号", "入库日期", "结算单位", "项目名称", "仓库名称", "业务类别", "采购类型"}
For Each st As String In sts '关联字段任一字段为空的话,不能新增明细表数据
If Forms("入库通知单登记").controls(st).value Is Nothing Then
MessageBox.Show("请将红色必填字段 " & st & " 填写完整!", "提醒")
Return
End If
Next
MessageBox.Show(1)
If Tables("入库明细").rows.count = 0 Then
MessageBox.Show("入库明细没有数据!", "提醒")
Return
End If
MessageBox.Show(2)
Dim dr As String() = {"品名", "材质", "规格", "产地", "厂发数量", "厂发重量","厂发单价", "含税金额"}
For Each mx As String In dr
If Tables("入库明细").Current.isnull(mx) = True Then
MessageBox.Show("入库明细中 " & mx & " 填写完整!", "提醒")
Return
End If
Next
MessageBox.Show(3)
For Each dt As DataTable In DataTables
If dt.HasChanges Then
e.Form.Controls("Label16").text = "正在保存数据..."
Application.Doevents
dt.Save
e.Form.Controls("Label16").text = ""
Else
e.Form.Controls("Label16").text = ""
e.Form.Controls("新单").Enabled = True
e.Form.Controls("退出").Enabled = True
End If
Next
MessageBox.Show(4)
'录入码单勾选
Tables("入库明细码单").AllowEdit = False
Dim gx As WinForm.CheckBox = e.Form.Controls("需要录入码单")
gx.Checked = False
e.Form.Controls("码单增加").Enabled = False
e.Form.Controls("码单编辑").Enabled = False
e.Form.Controls("码单行复制").Enabled = False
e.Form.Controls("码单删除").Enabled = False
e.Form.Controls("码单保存").Enabled = False
MessageBox.Show(5)
MessageBox.Show(3)没有通过,提示这个错误代码。没看出什么问题,老师帮忙看下谢谢
[此贴子已经被作者于2023/1/19 10:32:18编辑过]