以文本方式查看主题

-  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=73163)

--  作者:jinzhengbe
--  发布时间:2015/8/13 15:13:00
--  这个不为空的判断写在按钮代码里应该怎么

If e.DataRow.IsNull("user") Then

    MessageBox.Show("客户名不允许为空!")

    e.Cancel = True

End If


--  作者:有点蓝
--  发布时间:2015/8/13 15:29:00
--  
if CurrentTable.Current is nothing then
return
else 
if CurrentTable.Current.IsNull("user") then
   ..相应代码
end if
end if
或者Tables("表").Current.IsNull("user")

--  作者:大红袍
--  发布时间:2015/8/13 15:35:00
--  

If Tables("表A").Current.IsNull("user") Then

    MessageBox.Show("客户名不允许为空!")

End If


--  作者:jinzhengbe
--  发布时间:2015/8/15 23:46:00
--  


If Tables("表A").Current.IsNull("user") Then

    MessageBox.Show("客户名不允许为空!")

End If



这段代码后面本来还有别的代码的,如果上面的的条件 成立就不执行后面的代码。 应该怎么处理?
我是按照下面的方法处理的,不管用, 请前辈们继续帮忙啊~~~

If Tables("chuandanhao.chuanhuo").Current.IsNull("user") Then
    MessageBox.Show("客户名不允许为空!")
  e.Cancel = True



DataTables("chuanhuo").DeleteFor("cord is null")
Dim Book As New XLS.Book(ProjectPath & "Attachments\\串货.xls") \'打开模板
Dim fl As String = ProjectPath & "Reports\\串货.xls"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
\'Sheet(3,9).Value = "<日期 = # " & Date.Today & "#>"  \'写入打印条件
Book.Build() \'生成报表
Book.Save(fl) 
Dim Proc As New Process 
Proc.File = fl
Proc.Start()

End If


--  作者:czy
--  发布时间:2015/8/16 0:35:00
--  
将 e.Cancel = True替换成 else
--  作者:大红袍
--  发布时间:2015/8/16 10:21:00
--  

 楼主,那些都是最基础的语法啊。

 

http://www.foxtable.com/help/topics/0223.htm