Dim txtBox As WinForm.TextBox
txtBox = e.Form.Controls("合同号栏")
txtBox.ReadOnly = BooleanEnum.True
在该控件的事件leave中编写代码:e.Sender.HideToolTip()
在该控件的事件Validating编写代码:
Tables("内部合同").Current("合同编号") = e.Sender.Text
If e.Sender.Value Is Nothing Then
e.Cancel = True
End If
With Forms("抽油杆分公司内部合同录入窗口").Controls("合同号栏")
Dim txt As String = .Value
If txt = "" OrElse txt.Length <> 11 Then
Messagebox.Show("必须按格式输入编号!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
End With
以前运行没有问题,但昨天开始运行时,在控件
“合同号栏”按格式输入2016-001-01后,显示“必须按格式输入编号!”,和上图错误提示,但在“内部合同”的表中已经输入了正确编号,如图
此主题相关图片如下:未命名1.bmp

重新输入有时候提示错误,有时候不再提示。
请问专家上述编码错在哪里?