Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共5 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:多表逐个条件查找

1楼
ganlan 发表于:2023/10/29 17:39:00
比如用一表,1A列的内容去,二表的2A列查找,找到了以二表中的2B列再去三表中的3A列查询,如果查找到,一表的1C列=三表的D列

我写了一下,出错。
If e.DataCol.Name = "1A" Then 
    If e.NewValue Is Nothing Then 
        e.DataRow("1C") = Nothing

    Else
        
        Dim ckmx As DataRow
            ckmx = DataTables("二表").Find("[2A] = '" & e.NewValue & "'")           
            If ckmx IsNot Nothing Then                  
                  Dim ckbt As DataRow
                  ckbt = DataTables("三表").Find("[3A] = '" & ckmx("2B") & "'")
                  If ckbt IsNot Nothing Then
                      e.DataRow("1C") = ckbt("3D")
                      Else
                      e.DataRow("1C") = Nothing
                  End If 

            End If
    End If
End If
[此贴子已经被作者于2023/10/29 17:41:12编辑过]
2楼
ganlan 发表于:2023/10/29 17:42:00
哦,可以了
3楼
ganlan 发表于:2023/10/29 18:09:00
如果内容需要分割,直接这样改会提示出错,请问怎么修改合适,谢谢
 e.DataRow("1C") = ckbt("3D").split("/",0)
4楼
有点蓝 发表于:2023/10/29 20:08:00
e.DataRow("1C") = ckbt("3D").split("/")(0)
5楼
ganlan 发表于:2023/10/30 9:40:00
好的,谢谢
共5 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03125 s, 2 queries.