以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]引用变量  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=39508)

--  作者:yuyijun2
--  发布时间:2013/8/26 10:18:00
--  [求助]引用变量
 

For Each dr1 As DataRow In DataTables("表A").Select("[金额] > r")
    Dim
dr2 As DataRow = DataTables("表B"
).AddNew()
   
For Each dc As DataCol in DataTables("表A"
).DataCols
        dr2(dc.Name) = dr1(dc.name)
   
Next
Next

 

  我想将r引用窗口控件"TextBox1"的数据要怎么写?


--  作者:Bin
--  发布时间:2013/8/26 10:21:00
--  
.Select("[金额] > " & forms("窗口名").controls("TextBox1").Text)
--  作者:lsy
--  发布时间:2013/8/26 10:23:00
--  

For Each dr1 As DataRow In DataTables("表A").Select("[金额] > " & Val(Forms("窗口1").Controls("TextBox1").Text))
    Dim
dr2 As DataRow = DataTables("表B"
).AddNew()
   
For Each dc As DataCol in DataTables("表A"
).DataCols
        dr2(dc.Name) = dr1(dc.name)
   
Next
Next