以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  find问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=162976)

--  作者:wangglby
--  发布时间:2021/4/19 12:21:00
--  find问题

有个问题请教下:

 

表A有列   单重  和   修正值,表B有  修正值  和  条件  2个列

 

现在想在表B中寻找符合条件的修正值,赋值到表A中的修正值列

 

 

e.DataRow("修正值")=DataTables("表B").Find("[条件]     ")("修正值")

 

 

请问FIND中的代码怎么写?如果为方便写代码,表B的条件列内容也可以修改下内容或样式

 


图片点击可在新窗口打开查看此主题相关图片如下:捕获21.png
图片点击可在新窗口打开查看
[此贴子已经被作者于2021/4/19 12:30:44编辑过]

--  作者:有点蓝
--  发布时间:2021/4/19 13:39:00
--  
条件列改为2个列:
条件1,条件2
0,1
1,5
5,999

然后代码

dim dr as datarow = DataTables("表B").Find("[条件1] > " & e.DataRow("单重") & " and [条件2] <=" & e.DataRow("单重"))
if dr isnot nothing then
e.DataRow("修正值")= dr("修正值")
end if

--  作者:wangglby
--  发布时间:2021/4/19 15:11:00
--  

 谢谢