Foxtable(狐表)用户栏目专家坐堂 → 跨表删除行


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

主题:跨表删除行

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


加好友 发短信
等级:超级版主 帖子:107440 积分:546479 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/6/1 16:17:00 [只看该作者]

1、上面的实例我测试没有问题,按什么步骤测试会有问题?

2、代码在"报价管理系统"datacolchanging事件。输出代码:http://www.foxtable.com/webhelp/topics/1987.htm,搜索提示文字,就知道代码在哪了

3、代码的顺序不对,勾选后业务员还没有值。要先给业务员赋值,在复制数据

If e.DataCol.Name = "传递报价" Then 
    If e.DataRow("传递报价") = True Then
        e.DataRow("录入时间") = Date.Today()
        e.DataRow("业务员") = User.Name
    Else
        e.DataRow("业务员") = Nothing
        e.DataRow("录入时间") = Nothing
    End If
End If
If e.DataCol.Name = "传递报价" AndAlso e.DataRow("传递报价") = True Then
    Dim nma() As String = {"图号", "业务员"} 'A表数据来源列
    Dim nmb() As String = {"图号","业务员"} 'B表数据接收列
    Dim dr As DataRow = DataTables("报价管理系统").AddNew
    For i As Integer = 0 To nma.Length - 1
        dr(nmb(i)) = e.DataRow(nma(i))
    Next
End If

上面2段代码可以合并到一起
If e.DataCol.Name = "传递报价" Then 
    
    If e.DataRow("传递报价") = True Then
        e.DataRow("录入时间") = Date.Today()
        e.DataRow("业务员") = User.Name
        
        Dim nma() As String = {"图号", "业务员"} 'A表数据来源列
        Dim nmb() As String = {"图号","业务员"} 'B表数据接收列
        Dim dr As DataRow = DataTables("报价管理系统").AddNew
        For i As Integer = 0 To nma.Length - 1
            dr(nmb(i)) = e.DataRow(nma(i))
        Next
    Else
        e.DataRow("业务员") = Nothing
        e.DataRow("录入时间") = Nothing
    End if
End If

 回到顶部
总数 11 上一页 1 2