Foxtable(狐表)用户栏目专家坐堂 → 基础资料限制是否要求录入值


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

主题:基础资料限制是否要求录入值

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/11/14 16:44:00 [显示全部帖子]

beforesavedatarow事件,写代码

 

Dim fdr As DataRow = DataTables("表A").find("编码='" & e.DataRow("编码") & "'")
If fdr IsNot Nothing Then
    If fdr("数量") = True Then
        If e.DataRow.IsNull("数量") Then
            msgbox("数量不能为空")
            Tables("表B").Select(Tables("表B").FindRow(e.DataRow), Tables("表B").Cols("数量").Index)
            e.cancel = True
        End If
    End If
    If fdr("部门") = True Then
        If e.DataRow.IsNull("部门") Then
            msgbox("部门不能为空")
            Tables("表B").Select(Tables("表B").FindRow(e.DataRow), Tables("表B").Cols("部门").Index)
            e.cancel = True
        End If
    End If
    If fdr("客户") = True Then
        If e.DataRow.IsNull("客户") Then
            msgbox("客户不能为空")
            Tables("表B").Select(Tables("表B").FindRow(e.DataRow), Tables("表B").Cols("客户").Index)
            e.cancel = True
        End If
    End If
End If


 回到顶部