Foxtable(狐表)用户栏目专家坐堂 → [求助]保存按钮提示未找到对象


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

主题:[求助]保存按钮提示未找到对象

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


加好友 发短信
等级:九尾狐 帖子:2927 积分:20161 威望:0 精华:0 注册:2012/2/3 17:45:00
[求助]保存按钮提示未找到对象  发帖心情 Post By:2015/1/13 23:19:00 [只看该作者]

有点甜老师,
保存按钮的代码是

Dim TV As WinForm.TreeView = e.Form.Controls("部门档案.tv")
Dim DH As WinForm.NavBar = Forms("欢迎使用").Controls("用户使用.N")
Dim tab As WinForm.TabControl = e.Form.Controls("TabControl1")
Dim zj As WinForm.Button = e.Form.Controls("部门档案.B.增加")
Dim PL As WinForm.SplitContainer = e.Form.Controls("软件表头.S")
If Tables("部门档案").Current.DataRow Is Nothing Then
    vars("pclose") = True
    tab.TabPages(1).Visible = False
Else
    If Tables("部门档案").Current.isnull("编码规则") = True Then
        MessageBox.Show("编码不能为空!","提示")
        Return
    Else
        If Tables("部门档案").Current.isnull("编码名称") = True Then
            MessageBox.Show("名称不能为空!","提示")
            Return
        Else
            TV.Enabled=True
            DH.Enabled=True
            zj.Enabled=True
            pl.Enabled=True
            Tables("部门档案").Current.Save
            Tables("部门档案").Current.Locked=True
            Dim clr As Color = Color.FromARGB(255,228,196)
            For Each c As WinForm.Control In e.Form.Controls
                If Typeof c Is WinForm.TextBox Then '判断控件是否是文本框
                    c.BackColor = Clr
                End If
                If Typeof c Is WinForm.ComboBox Then
                    c.BackColor = Clr
                End If
            Next
            vars("pclose") = True
            tab.TabPages(1).Visible = False
        End If
    End If
End If

.NET Framework 版本:2.0.50727.4984
Foxtable 版本:2014.11.11.1
错误所在事件:窗口,欢迎使用,部门档案.B.退出,Click
详细错误信息:
未将对象引用设置到对象的实例。
没看出问题呀,烦您帮忙看一下,谢谢。

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


加好友 发短信
等级:贵宾 帖子:35433 积分:178524 威望:0 精华:3 注册:2013/3/30 16:36:00
  发帖心情 Post By:2015/1/14 8:07:00 [只看该作者]

加入IF判断一下

if  If Tables("部门档案").Current isnot nothing then
   再执行你的代码
end if

 回到顶部