Foxtable(狐表)用户栏目专家坐堂 → 窗口录入问题


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

主题:窗口录入问题

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


加好友 发短信
等级:幼狐 帖子:81 积分:632 威望:0 精华:0 注册:2018/4/17 11:59:00
窗口录入问题  发帖心情 Post By:2018/5/9 16:36:00 [只看该作者]


图片点击可在新窗口打开查看此主题相关图片如下:1.jpg
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:2.jpg
图片点击可在新窗口打开查看

您好!帮忙解决一下。谢谢!
现在输入生产编号,在生产日期和产品型号的文本框上显示所需的文本信息。但点击任何其他控件,已经显示的文本信息消失了。也不在记录表上录入。这是怎么回事?
产品编号textchanged事件的源代码是:
If e.sender.text.length > 3 Then 
    If e.sender.text(0) = "0" And e.sender.text(1)="1" Then
        e.Form.controls("TextBox4").text = "J18A1"
    End If
If e.sender.text(0) ="0" And e.sender.text(1)="2" Then
       e.Form.controls("TextBox4").text = "J18A2"
    End If
If e.sender.text(0) = "0" And e.sender.text(1)="3" Then

        e.Form.controls("TextBox4").text = "J18C"
    End If
If e.sender.text(0) = "0" And e.sender.text(1)="4" Then
        e.Form.controls("TextBox4").text = "J18B"
    End If
If e.sender.text(0) ="0" And e.sender.text(1)="5" Then

        e.Form.controls("TextBox4").text = "J48A"
    End If
If e.sender.text(0) = "0" And e.sender.text(1)="6" Then

        e.Form.controls("TextBox4").text = "J48B"
    End If
 If e.sender.text(0) = "1" And e.sender.text(1)="1" Then
        e.Form.controls("TextBox4").text = "J18A3"
    End If
If e.sender.text(0) ="1" And e.sender.text(1)="2" Then

        e.Form.controls("TextBox4").text = "J18BX"
    End If
If e.sender.text(0) = "1" And e.sender.text(1)="3" Then

        e.Form.controls("TextBox4").text = "J58A"
    End If
If e.sender.text(0) = "0" And e.sender.text(1)="7" Then
        e.Form.controls("TextBox4").text = "SD608"
    End If
If e.sender.text(0) ="0" And e.sender.text(1)="8" Then

        e.Form.controls("TextBox4").text = "JC609"
    End If
If e.sender.text(0) = "0" And e.sender.text(1)="9" Then

        e.Form.controls("TextBox4").text = "NES809"
    End If

If e.sender.text(0) = "1" And e.sender.text(1)="0" Then

        e.Form.controls("TextBox4").text = "PC708"
    End If
If e.sender.text(0) = "1" And e.sender.text(1)="4" Then
        e.Form.controls("TextBox4").text = "PC708A"
    End If
If e.sender.text(0) ="1" And e.sender.text(1)="5" Then

        e.Form.controls("TextBox4").text = "PC708R"
    End If
If e.sender.text(0) = "1" And e.sender.text(1)="6" Then

        e.Form.controls("TextBox4").text = "DB1207"
    End If
End If
If e.sender.text.length > 9 Then 
       e.Form.controls("TextBox1").text = e.sender.text.Substring(2,8)
End If
[此贴子已经被作者于2018/5/9 16:37:24编辑过]

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/5/9 16:48:00 [只看该作者]


 回到顶部
帅哥哟,离线,有人找我吗?
jinhetian
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:81 积分:632 威望:0 精华:0 注册:2018/4/17 11:59:00
  发帖心情 Post By:2018/5/10 9:06:00 [只看该作者]

谢谢老师,问题已经解决。

 回到顶部
帅哥哟,离线,有人找我吗?
jinhetian
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:81 积分:632 威望:0 精华:0 注册:2018/4/17 11:59:00
  发帖心情 Post By:2018/5/10 12:08:00 [只看该作者]

程序运行后出现错误对话框,关闭后程序能正常运行。
下面是对话框的内容:
.NET Framework 版本:2.0.50727.8762
Foxtable 版本:2018.3.9.1
错误所在事件:窗口,维修产品登记表,TextBox3,TextChanged
详细错误信息:
未将对象引用设置到对象的实例。


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/5/10 12:24:00 [只看该作者]


 回到顶部
帅哥哟,离线,有人找我吗?
jinhetian
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:81 积分:632 威望:0 精华:0 注册:2018/4/17 11:59:00
  发帖心情 Post By:2018/5/11 14:09:00 [只看该作者]

老师,错误对话框是执行了红色区域的代码后出现的。
If e.sender.text.length > 3 Then 
MessageBox.Show(1)
    If e.sender.text(0) = "0" And e.sender.text(1)="1" Then
MessageBox.Show(2)
        e.Form.controls("TextBox4").text = "J18A1"
MessageBox.Show(3)
        e.Form.controls("TextBox4").WriteValue


    End If

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/5/11 14:36:00 [只看该作者]

回复6楼,那就应该是你 datacolchanged 事件代码有错导致的。你删除事件代码看看。

 回到顶部
帅哥哟,离线,有人找我吗?
jinhetian
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:81 积分:632 威望:0 精华:0 注册:2018/4/17 11:59:00
  发帖心情 Post By:2018/5/11 14:47:00 [只看该作者]

老师帮我看一下,我真的无从下手,不知道怎么改?
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:质量手册.table

[此贴子已经被作者于2018/5/11 14:50:03编辑过]

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/5/11 16:05:00 [只看该作者]

修改代码

 

static flag As Boolean = False
If e.sender.text.length > 3 AndAlso flag Then

    If e.sender.text(0) = "0" And e.sender.text(1)="1" Then
        e.Form.controls("TextBox4").text = "J18A1"
        e.Form.controls("TextBox4").WriteValue
    End If
    If e.sender.text(0) ="0" And e.sender.text(1)="2" Then
        e.Form.controls("TextBox4").text = "J18A2"
        e.Form.controls("TextBox4").WriteValue
    End If
    If e.sender.text(0) = "0" And e.sender.text(1)="3" Then
       
        e.Form.controls("TextBox4").text = "J18C"
        e.Form.controls("TextBox4").WriteValue
    End If
    If e.sender.text(0) = "0" And e.sender.text(1)="4" Then
        e.Form.controls("TextBox4").text = "J18B"
        e.Form.controls("TextBox4").WriteValue
    End If
    If e.sender.text(0) ="0" And e.sender.text(1)="5" Then
       
        e.Form.controls("TextBox4").text = "J48A"
        e.Form.controls("TextBox4").WriteValue
    End If
    If e.sender.text(0) = "0" And e.sender.text(1)="6" Then
       
        e.Form.controls("TextBox4").text = "J48B"
        e.Form.controls("TextBox4").WriteValue
    End If
    If e.sender.text(0) = "1" And e.sender.text(1)="1" Then
        e.Form.controls("TextBox4").text = "J18A3"
        e.Form.controls("TextBox4").WriteValue
    End If
    If e.sender.text(0) ="1" And e.sender.text(1)="2" Then
       
        e.Form.controls("TextBox4").text = "J18BX"
        e.Form.controls("TextBox4").WriteValue
    End If
    If e.sender.text(0) = "1" And e.sender.text(1)="3" Then
       
        e.Form.controls("TextBox4").text = "J58A"
        e.Form.controls("TextBox4").WriteValue
    End If
    If e.sender.text(0) = "0" And e.sender.text(1)="7" Then
        e.Form.controls("TextBox4").text = "SD608"
        '        e.Form.controls("TextBox4").WriteValue
    End If
    If e.sender.text(0) ="0" And e.sender.text(1)="8" Then
       
        e.Form.controls("TextBox4").text = "JC609"
        e.Form.controls("TextBox4").WriteValue
    End If
    If e.sender.text(0) = "0" And e.sender.text(1)="9" Then
       
        e.Form.controls("TextBox4").text = "NES809"
        e.Form.controls("TextBox4").WriteValue
    End If
   
    If e.sender.text(0) = "1" And e.sender.text(1)="0" Then
       
        e.Form.controls("TextBox4").text = "PC708"
        e.Form.controls("TextBox4").WriteValue
    End If
    If e.sender.text(0) = "1" And e.sender.text(1)="4" Then
        e.Form.controls("TextBox4").text = "PC708A"
        e.Form.controls("TextBox4").WriteValue
    End If
    If e.sender.text(0) ="1" And e.sender.text(1)="5" Then
       
        e.Form.controls("TextBox4").text = "PC708R"
        e.Form.controls("TextBox4").WriteValue
    End If
    If e.sender.text(0) = "1" And e.sender.text(1)="6" Then
       
        e.Form.controls("TextBox4").text = "DB1207"
        e.Form.controls("TextBox4").WriteValue
    End If
End If
If e.sender.text.length > 9 AndAlso flag Then
    e.Form.controls("TextBox1").text = e.sender.text.Substring(2,8)
    e.Form.controls("TextBox1").WriteValue
End If
flag = True


 回到顶部
帅哥哟,离线,有人找我吗?
jinhetian
  10楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:81 积分:632 威望:0 精华:0 注册:2018/4/17 11:59:00
  发帖心情 Post By:2018/5/14 9:19:00 [只看该作者]

有点甜老师,问题解决了。有点甜老师有问必答!非常感谢!!

 回到顶部