With e.Form.Controls("订单编号")
Dim txt As String = .Value
If txt = "" OrElse txt.Length <> 13 Then
Messagebox.Show("必须输入13位数的编号!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
Else
Dim kjmc() As String '控件名称
Dim kjmcjh As String = "收样日期,预计完成日期,订单编号" '控件名称集合
kjmc = kjmcjh.Split(",")
For i As Integer=0 To kjmc.Length-1
If e.Form.Controls(kjmc(i)).value Is Nothing Then
MessageBox.Show(kjmc(i) & "不能为空,请检查")
e.Form.Controls(kjmc(i)).Select
Return
End If
Next
DataTables("T_Order").save
MessageBox.Show("保存成功")
End If
End With
点击按键 若订单编号字数不够13位的时候提醒并返回当前作业,若满足则进一步检查其它控件是否为空,若空返回,若不空则保存;
但这个是否会判定字数是否足够,但若不够13位还是会执行保存,请问哪里错了?