以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  复选框筛选  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=20898)

--  作者:wilson
--  发布时间:2012/6/22 14:12:00
--  复选框筛选

我想把订单明细表的订单号等于复选框ComboBox1里的订单号,填入到订单表

我用以下代码调试无效

求助,谢谢

Dim Cols1() As String = {"订货日期","客户名称","订单号","产品型号","产品名称","产品规格","产品颜色","数量","金额","已发货","备注"}
Dim Cols2() As String = {"订货日期","客户名称","订单号","产品型号","产品名称","产品规格","产品颜色","数量","金额","已发货","备注"}
Dim dhrq As String = e.Form.Controls("ComboBox1").text   

                               \'e.Form.Controls("ComboBox1").Value
For Each dr1 As DataRow In DataTables("订单明细表").Select("订单号 = \'dhrq\'")  

    Dim dr2 As DataRow = DataTables("订单表").AddNew()
    For i As Integer = 0 To Cols1.Length -1
        dr2(Cols2(i)) = dr1(Cols1(i))
    Next
Next
MainTable= Tables("订单表")


--  作者:ahbzczy
--  发布时间:2012/6/23 6:25:00
--  

Dim Cols1() As String = {"订货日期","客户名称","订单号","产品型号","产品名称","产品规格","产品颜色","数量","金额","已发货","备注"}
Dim Cols2() As String = {"订货日期","客户名称","订单号","产品型号","产品名称","产品规格","产品颜色","数量","金额","已发货","备注"}
Dim dhrq As String = e.Form.Controls("ComboBox1").text   

                               \'e.Form.Controls("ComboBox1").Value
For Each dr1 As DataRow In DataTables("订单明细表").select("订单号 = \'" & dhrq & "\'")  

    Dim dr2 As DataRow = DataTables("订单表").AddNew()
    For i As Integer = 0 To Cols1.Length -1
        dr2(Cols2(i)) = dr1(Cols1(i))
    Next
Next
MainTable= Tables("订单表")

[此贴子已经被作者于2012-6-23 9:24:40编辑过]

--  作者:wilson
--  发布时间:2012/6/24 19:29:00
--  

问题已解决,谢谢!!!