Foxtable(狐表)用户栏目专家坐堂 → [求助]函数isnull问题


  共有2757人关注过本帖树形打印复制链接

主题:[求助]函数isnull问题

帅哥哟,离线,有人找我吗?
bashanren
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:316 积分:2899 威望:0 精华:0 注册:2009/7/25 18:29:00
[求助]函数isnull问题  发帖心情 Post By:2019/3/18 17:44:00 [只看该作者]

各位老师下午好!!!
我在“文件管理”的表属性的“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


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By: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

 回到顶部