以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  资料出现混乱  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=104624)

--  作者:tuohai
--  发布时间:2017/8/2 9:27:00
--  资料出现混乱
图片点击可在新窗口打开查看
我录入货号 250 ”描述列“ 应该是 ELE单侧字母棒球服  但是录进去之后"描述列“变成了 EJ抽腰拉链长帽衫     
只是个别行会有这样的情况

获取资料的代码如下。
\'获取服装资料
Dim gl As DataRow
gl = DataTables("服装资料表").Find("[服装资料_货号] = \'" & e.NewValue & "\'")
If gl IsNot Nothing Then \'如果找到了,也就是dr不是Nothing
e.DataRow("服装资料_描述") = gl("服装资料_描述")
e.DataRow("服装资料_A") = gl ("服装资料_A")
e.DataRow("服装资料_B") = gl("服装资料_B")
e.DataRow("服装资料_D") = gl("服装资料_D")
e.DataRow("服装资料_Tel") = gl("服装资料_Tel")
End If

--  作者:newsun2k
--  发布时间:2017/8/2 9:31:00
--  
肯定有两笔数据,我猜的
--  作者:有点甜
--  发布时间:2017/8/2 9:31:00
--  

 每次录入250,都是得到同样的值?是不是你有两个250的货号?

 

 你的赋值代码那里,加入msgbox,弹出值是否正确。


--  作者:tuohai
--  发布时间:2017/8/2 9:38:00
--  
代码放在DataColChanged

没有重复货号


--  作者:tuohai
--  发布时间:2017/8/2 9:45:00
--  
只有一笔


--  作者:有点甜
--  发布时间:2017/8/2 10:06:00
--  
你不判断列名?
 
If e.DataCol.Name = "服装资料_货号" Then
    Dim gl As DataRow
    gl = DataTables("服装资料表").Find("[服装资料_货号] = \'" & e.NewValue & "\'")
    If gl IsNot Nothing Then \'如果找到了,也就是dr不是Nothing
        e.DataRow("服装资料_描述") = gl("服装资料_描述")
        e.DataRow("服装资料_A") = gl ("服装资料_A")
        e.DataRow("服装资料_B") = gl("服装资料_B")
        e.DataRow("服装资料_D") = gl("服装资料_D")
        e.DataRow("服装资料_Tel") = gl("服装资料_Tel")
    End If
End If

--  作者:tuohai
--  发布时间:2017/8/2 10:46:00
--  
解决了,谢谢老师。