以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- sqlfind (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=92967) |
-- 作者:lk15502 -- 发布时间:2016/11/17 13:14:00 -- sqlfind 帮我看看下面的代码逻辑上和代码本身有什么问题?执行到3就停止了,直到循环结束,
If _usergroup = "成品仓库" OrElse _userroles.Contains("成品仓库") = True Then If Tables(e.Form.Name & "_table9").Rows.count > 0 Then If MessageBox.Show("是否复制到成品入库表?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Warning) = DialogResult.Yes Then For Each r1 As Row In Tables(e.Form.Name & "_table9").Rows msgbox(1) If r1("下一工序") = "成品仓库" And r1("成品") = False And DataTables("成品入库表").SQLFind("缸号 = \'" & r1("缸号") & "\' and 缸号类型 = \'" & r1("缸号类型") & "\'") Is Nothing Then msgbox(2) Dim r3 As DataRow = DataTables("定型产量表").SQLFind("加工类型 = \'打包称重\' and 下一工序 = \'成品仓库\' and 缸号 = \'" & r1("缸号") & "\' and 缸号类型 = \'" & r1("缸号类型") & "\'") msgbox(3) If r3 IsNot Nothing Then msgbox(r3("缸号")) Dim r2 As Row = Tables("成品入库表").AddNew Dim Cols1() As String = {"订单明细编号对外","品名大类","品名小类","成品克重","成品门幅","颜色","缸号类型","缸号","色号","客户","销售人员"} Dim Cols2() As String = {"订单明细编号对外","品名大类","品名小类","克重","门幅","颜色","缸号类型","缸号","色号","客户","销售人员"} For i As Integer = 0 To Cols1.length -1 If r1.Isnull(Cols1(i)) = False Then r2(Cols2(i)) = r1(Cols1(i)) End If r2("重量") = r3("定型重量") r2("匹数") = r3("定型匹数") Next r2.save End If End If Next End If End If Else MessageBox.Show("您没有操作权限!","提示") End If |
-- 作者:有点蓝 -- 发布时间:2016/11/17 14:31:00 -- 说明r3查出来都是空值 |
-- 作者:有点青 -- 发布时间:2016/11/17 15:43:00 -- 把你的查询条件弹出来看一下,然后对比着去数据库里查,看是否有对应的数据。 |