以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]函数isnull问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=132274)

--  作者:bashanren
--  发布时间:2019/3/18 17:44:00
--  [求助]函数isnull问题
各位老师下午好!!!
我在“文件管理”的表属性的“datacolchanged"事件中的代码如下,当”文号前缀“和”年号“都不为空时,不知怎么总是不能运行”ELSE“以下的代码?请老师帮忙修改指导一下,谢谢老师们,辛苦了!!
If e.DataCol.name ="文件序号" Then
Dim dr As DataRow=e.DataRow
  If dr.Isnull("文号前缀") Then
        MessageBox.Show("文号前缀和文件年号不能为空值!", "提示")
      e.Cancel = True
   End If
Else
    Dim qz As String = e.DataRow("文号前缀")
MessageBox.show(qz)
    Dim nh As String = e.DataRow("年号")
    Dim xh As String = e.DataRow("文件序号") 
    e.DataRow("文号") = qz & "【" & nh & "】" & xh & "号"
End If


--  作者:有点甜
--  发布时间:2019/3/18 18:06:00
--  
If e.DataCol.name="文件前缀" OrElse e.DataCol.name="年号" Then
    Dim dr As DataRow=e.DataRow
    If dr.Isnull("文号前缀") OrElse dr.IsNull("年号") Then
        MessageBox.Show("文号前缀和文件年号不能为空值!", "提示")
        e.Cancel = True
       
    Else
        Dim qz As String = e.DataRow("文号前缀")
        MessageBox.show(qz)
        Dim nh As String = e.DataRow("年号")
        Dim xh As String = e.DataRow("文件序号")
        e.DataRow("文号") = qz & "【" & nh & "】" & xh & "号"
    End If   
End If