Foxtable(狐表)用户栏目专家坐堂 → [求助]未将对象引用设置到对象的实例


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

主题:[求助]未将对象引用设置到对象的实例

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


加好友 发短信
等级:婴狐 帖子:24 积分:322 威望:0 精华:0 注册:2014/9/11 11:49:00
[求助]未将对象引用设置到对象的实例  发帖心情 Post By:2015/8/19 14:44:00 [只看该作者]

以下代码实现:选中窗口“信息查询” 中 副本表“tabresult"中的行,然后按选中行中的”品类编号“值,,在表”业态分类“中查询相应信息条

代码如下,,,但运行时会提示”未将对象引用设置到对象的实例“的错误,,,,请教哪里出问题了??


Dim str As String
Dim Frm As WinForm.Form = Forms("信息查询")
If  Tables("信息查询_tabResult").Rows.Count > 0 Then
    str = Tables("信息查询_tabResult").Current("品类编号") 
    Dim dt As DataTable = DataTables("业态分类表")
    Dim r As DataRow
    r = dt.Find("[品类编号] = '" & str & "'")
    Frm.Controls("txtClass").Text = r("大类").SubString(1) & "/" & r("业态").SubString(1) & "/" & r("业种").SubString(2) & "/" & r("品类").SubString(2)
End If

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/8/19 14:48:00 [只看该作者]

Dim str As String
Dim Frm As WinForm.Form = Forms("信息查询")
If frm.Opened AndAlso Tables("信息查询_tabResult").Rows.Count > 0 Then
    str = Tables("信息查询_tabResult").Current("品类编号")
    Dim dt As DataTable = DataTables("业态分类表")
    Dim r As DataRow
    r = dt.Find("[品类编号] = '" & str & "'")
    If r IsNot Nothing Then
        Frm.Controls("txtClass").Text = r("大类").SubString(1) & "/" & r("业态").SubString(1) & "/" & r("业种").SubString(2) & "/" & r("品类").SubString(2)
    Else
        Frm.Controls("txtClass").Text = Nothing
    End If
End If

 回到顶部