Dim dr1 As Table
Dim st As String = e.Form.Controls("TextBox1").value
Dim cd As String
Dim sf As String
Dim sfC As String = e.Form.Controls("ComboBox1").text
Dim dt As Date = e.Form.Controls("DateTimePicker1").value
Dim dts As String
If e.Form.Controls("DateTimePicker1").value IsNot Nothing Then '判断日期 转换日期为字符串
dts=format(dt,"yyyyMMdd")
Else
messagebox.show("请输入收发货日期!")
Return
End If
If st IsNot Nothing Then '判断单号,转换单号为两位字符
If cint(st)>0 And cint(st)<10 Then
st="0" & st
Else If cint(st)<1 Or cint(st)>99 Then
messagebox.show("超出范围!")
e.Form.Controls("TextBox1").text=""
Return
End If
Else
messagebox.show("请输入收货或发货的工单号数!")
Return
End If
If sfc IsNot Nothing Then '判断收发货,并标注单号的首字母
If sfc="发货" Then
sf="F"
Else
sf="S"
End If
Else
messagebox.show("请选择<收货>还是<发货>!")
Return
End If
If e.Form.Controls("ComboBox4").value Is Nothing Then
messagebox.show("请选择相关客户!")
Return
End If
Tables("收发货").addnew()
Tables("收发货").current("收发货单号")=sf & dts & st
output.show(Tables("收发货").current("收发货单号"))
Tables("收发货").current("收发日期")=dt
Tables("收发货").current("类别")=sfc
Tables("收发货").current("客户ID")=e.Form.Controls("ComboBox4").value
最后几行向“收发货”表里添加记录 不知为什么是空的,请老师帮忙分析一下