以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  并列条件语句  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=52504)

--  作者:mayjun01
--  发布时间:2014/6/17 11:25:00
--  并列条件语句

 

这样的并列条件语句是不支持的吗?

 If e.DataRow.IsNull("日期") & e.DataRow.IsNull("线别") & e.DataRow.IsNull("工段") & e.DataRow.IsNull("考核编号") & e.DataRow.IsNull("考核项目") & e.DataRow.IsNull("考核内容") & e.DataRow.IsNull("奖罚")  Then
DataTables("日考核").Save()
End If


--  作者:Bin
--  发布时间:2014/6/17 11:27:00
--  
把 &  换成  andalso     这不是C#
--  作者:mayjun01
--  发布时间:2014/6/17 12:25:00
--  

需要换行吗


--  作者:mayjun01
--  发布时间:2014/6/17 12:39:00
--  

点击保存按钮,要求在保存之前首先判断必填的几个单元格是否为空,是该单元格获得焦点,否则保存该表。该如何实现?

如:日期、线别、工段、考核编号、考核内容、奖罚 这几列在新增一行后保存表格前必须有内容。该如何实现?


--  作者:Bin
--  发布时间:2014/6/17 14:03:00
--  
http://www.foxtable.com/help/topics/0617.htm
--  作者:有点甜
--  发布时间:2014/6/17 14:13:00
--  

参考代码

 

Dim nms() As String = {"第一列","第二列","第三列"}

Dim ep As String
For Each nm As String In nms
    If e.DataRow.isnull(nm) Then
         ep= nm
         Exit For
    End If
Next

If ep > "" Then
    messagebox.show(ep & "不能为空")
    e.Cancel = True
End If


--  作者:mayjun01
--  发布时间:2014/6/17 18:44:00
--  

甜老师,关键是日期,考核编号不是字符型的,这样设计好像不行


--  作者:有点甜
--  发布时间:2014/6/17 19:05:00
--  

 代码就是这样写,有什么不行?

 

Dim nms() As String = {"日期","考核编号","线别"}

Dim ep As String = ""
For Each nm As String In nms
    If e.DataRow.isnull(nm) Then
         ep= nm
         Exit For
    End If
Next

If ep > "" Then
    messagebox.show(ep & "不能为空")
    e.Cancel = True
End If


--  作者:mayjun01
--  发布时间:2014/6/17 22:04:00
--  

甜老师,报错了。If e.DataRow.isnull(nm) Then

"datarow" is not a number of \'controlEventArgs\'


--  作者:有点甜
--  发布时间:2014/6/17 22:05:00
--  
 写到beforesavedatarow表事件去。