Foxtable(狐表)官方栏目BUG收集 → e.Cancel=True 无效或不执行


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

主题:e.Cancel=True 无效或不执行

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


加好友 发短信
等级:婴狐 帖子:3 积分:109 威望:0 精华:0 注册:2017/8/29 12:11:00
e.Cancel=True 无效或不执行  发帖心情 Post By:2017/10/8 15:21:00 [显示全部帖子]

代码如下,每次重新打项目,e.Cancel=True都不执行或无效,需要再次进入编辑保存才会有效,不知是何原因?
If Tables("凭证.凭证分录.外币分录").Rows.Count()=0 Then
    messagebox.show("必须录入原币金额!","提示",MessageBoxButtons.OK ,MessageBoxIcon.Information)
    e.Cancel=True
Else
    Dim bbje As Single =Tables("凭证.凭证分录.外币分录").Current("本币金额")
    Dim fx As String=Tables("凭证.凭证分录.外币分录").Current("方向")
    Dim bzdm As String=Tables("凭证.凭证分录.外币分录").Current("币种代码")
    Dim ybje As Single =Tables("凭证.凭证分录.外币分录").Current("原币金额")
    Dim hl As Single =Tables("凭证.凭证分录.外币分录").Current("汇率")
    Dim jfje As Single= Tables("凭证.凭证分录").Current("借方金额")
    Dim dfje As Single=Tables("凭证.凭证分录").Current("贷方金额")

    If bzdm="" Or fx="" Or ybje=0 Or hl=0 Then
        messagebox.show("各项目不能为空!")
        e.Cancel=True
    Else
        If fx="借"  Then
            If bbje<>jfje Then
                messagebox.show("本币金额与分录借方金额不一致!")
                e.Cancel=True
            End If
        End If
        If fx="贷" Then
            If bbje<>dfje Then
                messagebox.show("本币金额与分录贷方金额不一致!")
                e.Cancel=True
            End If
        End If
    End If
End If

 回到顶部