Foxtable(狐表)用户栏目专家坐堂 → 不是成员处理


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

主题:不是成员处理

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


加好友 发短信
等级:一尾狐 帖子:408 积分:3642 威望:0 精华:0 注册:2017/4/8 8:59:00
不是成员处理  发帖心情 Post By:2020/5/6 9:44:00 [只看该作者]

Select Case e.DataCol.name
    Case "cpbm"
        If e.DataCol.Name = "cpbm" Then
            If e.DataRow.IsNull("cpbm")  Then
                e.DataRow("fxrq") = Nothing
                e.DataRow("qxrq") = Nothing
                ' e.DataRow("zxrq") = Nothing
            Else
                If e.DataRow.rowstate <> DataRowState.Unchanged Then
                    Dim ddr0 As DataRow
                    Dim max As Date
                    max = e.DataTable.Compute("Max(zxrq)")
                    ddr0 = DataTables("dk_lxb").Find("[cpbm] = '" & e.DataRow("cpbm")  & "'","zxrq desc")
                    If ddr0 IsNot Nothing
                        Dim zx1 As Date = ddr0("zxrq") '止息日期
                        Dim zx2 As Date = zx1.addmonths(1)   '第二次止息日期
                        Dim fx1 As Date = ddr0("fxrq")
                        Dim fx2 As Date = fx1.addmonths(1)
                        Dim qx1 As Date = ddr0("qxrq")
                        Dim qx2 As Date = qx1.addmonths(1)
                        e.DataRow("fxrq") = fx2
                        e.DataRow("qxrq") = qx2
                        
                        Dim d As Date = e.DataRow("qxrq")
                        If d.Day = 1 Then
                            e.DataRow("zxrq") = new Date(d.Year,d.Month,Date.DaysInMonth(d.Year,d.Month))
                        Else
                            e.DataRow("zxrq") = zx2
                        End If
                        
                    End If
                End If
            End If
        End If
End Select

以上代码我要写在chick按钮事件里,增加一行后执行。提示e.DataCol不是....成员。对这种情况如何处理呢?类似这种情况如何变通?

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106688 积分:542629 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/5/6 9:50:00 [只看该作者]

e.DataCol、e.DataRow这些是表事件才有的用法。如果放到按钮里,去掉列名的判断,把e.DataRow改为当前行如:tables("表A").current

 回到顶部