换个思路,代码不变,移到车号1和吨位1的Enter事件中。 http://www.foxtable.com/webhelp/scr/0734.htm
或者写在全局的Enter事件中,代码可以改为: Dim val As String Dim dr As DataRow = Tables("FAJHB").Current.DataRow If e.sender.name = "车号1" OrElse e.Sender.Name = "吨位1" Then If val = dr.SQLGetValue("过磅1")= True Then e.form.controls("车号1").ReadOnly = BooleanEnum.True e.Form.controls("吨位1").ReadOnly = BooleanEnum.True Else e.form.controls("车号1").ReadOnly = BooleanEnum.False e.Form.controls("吨位1").ReadOnly = BooleanEnum.False End If End If
|