Foxtable(狐表)用户栏目专家坐堂 → 关于自动输入问题


  共有1778人关注过本帖树形打印复制链接

主题:关于自动输入问题

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By: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


 回到顶部