以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  关于自动输入问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=108182)

--  作者:有点蓝
--  发布时间:2017/10/17 22:30:00
--  
测试代码没有问题哦。删除项目里的bin目录,重启项目试试

只是2个窗口都用到同一个表,其中一个必须设置为副本http://www.foxtable.com/webhelp/scr/1906.htm

--  作者:有点蓝
--  发布时间:2017/10/17 23:13:00
--  
这是代码不是sql,代码要写到事件中:http://www.foxtable.com/webhelp/scr/1445.htm


 下载信息  [文件大小:   下载次数: ]
点击浏览该文件:生产条码系统.table



--  作者:有点甜
--  发布时间:2017/10/18 14:37:00
--  

 不就是查两个表而已?修改代码

 

If e.DataCol.Name = "毛坯编码" Then
    Dim nms() As String = {"生产批次","批次序号","成品编码","成品描述"}
    If e.NewValue = Nothing Then
        For Each nm As String In nms
            e.DataRow(nm) = Nothing
        Next
    Else
        Dim dr As DataRow
        dr = DataTables("条码基础数据").Find("[毛坯编码] = \'" & e.NewValue & "\'")
        If dr IsNot Nothing
            For Each nm As String In nms
                e.DataRow(nm) = dr(nm)
            Next
        End If
    End If
ElseIf e.DataCol.name = "成品编码" Then
    Dim nms() As String = {"工序号"}
    Dim nms1() As String = {"加工工序"}
    If e.NewValue = Nothing Then
        For Each nm As String In nms
            e.DataRow(nm) = Nothing
        Next
    Else
        Dim dr As DataRow
        dr = DataTables("工艺路线").Find("[成品编码] = \'" & e.NewValue & "\'")
        If dr IsNot Nothing
            For i As Integer = 0 To nms.length-1
                e.DataRow(nms(i)) = dr(nms1(i))
            Next
        End If
    End If
End If