Foxtable(狐表)用户栏目专家坐堂 → 表中的代码怎么转换为按钮中的代码


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

主题:表中的代码怎么转换为按钮中的代码

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


加好友 发短信
等级:九尾狐 帖子:2234 积分:15278 威望:0 精华:0 注册:2015/7/18 10:10:00
表中的代码怎么转换为按钮中的代码  发帖心情 Post By:2016/7/31 11:46:00 [只看该作者]

'If e.DataCol.name = "余额" Then
    'Dim dr As DataRow = e.DataTable.Find("[_SortKey] < " & e.DataRow("_SortKey"), "[_SortKey] Desc") '找出上一行
    'If dr Is Nothing Then
        'e.DataRow("借贷方") = "贷"
    'Else
        'If e.DataRow("余额") > dr("余额")
            'e.DataRow("借贷方") = "贷"
        'Else
            'e.DataRow("借贷方") = "借"
        'End If
    'End If
'End If
'If e.DataCol.name = "借贷方" Then
    'If e.DataRow("借贷方") = "贷" Then
        'e.DataRow("贷方金额") = e.DataRow("交易金额")
    'Else
        'e.DataRow("借方金额") = e.DataRow("交易金额")
    'End If
'End If

上述代码是一个表中datacolchange事件中的代码,由于有时数据量非常大,导致无法运行,我想建立一个窗口,把表放在窗口中,然后用按钮实现上述功能,该怎么改呀?


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/31 11:51:00 [只看该作者]

Dim er As Row = Tables("表A").current
Dim dr As DataRow = er.table.datatable.Find("[_SortKey] < " & er("_SortKey"), "[_SortKey] Desc") '找出上一行
If dr Is Nothing Then
    er("借贷方") = "贷"
Else
    If er("余额") > dr("余额")
        er("借贷方") = "贷"
    Else
        er("借贷方") = "借"
    End If
End If

If er("借贷方") = "贷" Then
    er("贷方金额") = er("交易金额")
Else
    er("借方金额") = er("交易金额")
End If

 


 回到顶部