以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  新人求教-查找的问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=130252)

--  作者:hcfbehero
--  发布时间:2019/1/16 23:07:00
--  新人求教-查找的问题
本人刚学狐表,做个小小的统计表,想请教高手帮编辑下公式,如下图中,表B是各公司的基础信息,我想在表A中找到相关公司在表B的内容显示在相关列中,即表A中名称列的公司在表B中出现的就在存在列显示D,没有的就显示X,编号列中显示公司在表B中编号列的内容,单价就显示表B中相关月份的单价
求公式或是方法

图片点击可在新窗口打开查看此主题相关图片如下:微信截图_20190114112516.png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:微信截图_20190114112453.png
图片点击可在新窗口打开查看

[此贴子已经被作者于2019/1/16 23:09:39编辑过]

--  作者:有点甜
--  发布时间:2019/1/16 23:08:00
--  

http://www.foxtable.com/webhelp/scr/1451.htm

 

 


--  作者:hcfbehero
--  发布时间:2019/1/17 16:02:00
--  
那个看不懂,能不能帮写个公式,我好照例看说明
--  作者:有点甜
--  发布时间:2019/1/17 16:09:00
--  

datacolchanged事件

 

If e.datacol.name = "名称" orelse e.datacol.name = "单价月份" Then

    Dim fdr As DataRow = DataTables("表B").find("名称=\'" & e.datarow("名称") & "\'")

    If fdr IsNot Nothing Then

        e.datarow("存在") = "D"

        e.datarow("编号") = fdr("编号")

        If fdr.datatable.datacols.contains(e.datarow("单价月份")) then

            e.datarow("单价") = fdr(e.datarow("单价月份"))

        Else

            e.datarow("单价") = nothing

        End If

    Else

        e.datarow("存在") = "X"

        e.datarow("编号") = nothing

        e.datarow("单价") = nothing

    End If

End If


--  作者:hcfbehero
--  发布时间:2019/1/17 23:56:00
--  
非常感谢,存在和编号那个实现了,就是单价没出来,还有就是能不能用FX那个公式来实现这几个公能呀。
--  作者:有点甜
--  发布时间:2019/1/18 8:50:00
--  

If e.datacol.name = "名称" orelse e.datacol.name = "单价月份" Then

    Dim fdr As DataRow = DataTables("表B").find("名称=\'" & e.datarow("名称") & "\'")

    If fdr IsNot Nothing Then

        e.datarow("存在") = "D"

        e.datarow("编号") = fdr("编号")

        If fdr.datatable.datacols.contains("单价" & e.datarow("单价月份")) then

            e.datarow("单价") = fdr("单价" & e.datarow("单价月份"))

        Else

            e.datarow("单价") = nothing

        End If

    Else

        e.datarow("存在") = "X"

        e.datarow("编号") = nothing

        e.datarow("单价") = nothing

    End If

End If


--  作者:hcfbehero
--  发布时间:2019/2/9 2:13:00
--  
甜版主,你的邮件怎么发不了呀,退信了,有事找您私聊
--  作者:有点甜
--  发布时间:2019/2/10 11:40:00
--  
以下是引用hcfbehero在2019/2/9 2:13:00的发言:
甜版主,你的邮件怎么发不了呀,退信了,有事找您私聊

 

有问题直接在论坛里面发即可。如果问题没有解决,把实例发上来测试一下。