Foxtable(狐表)用户栏目专家坐堂 → 各位老大再一次请教,谢谢


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

主题:各位老大再一次请教,谢谢

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


加好友 发短信
等级:管理员 帖子:47448 积分:251060 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/7/6 10:52:00 [显示全部帖子]

你之前不是提过同样的问题吗?

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


加好友 发短信
等级:管理员 帖子:47448 积分:251060 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/7/6 11:50:00 [显示全部帖子]

删除表之后,再执行一次打勾的代码即可。

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


加好友 发短信
等级:管理员 帖子:47448 积分:251060 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/7/6 14:14:00 [显示全部帖子]

自己改写一下我之前给你的代码,放在CurrentTableChanged事件中:

 

 

 

For Each dr As DataRow In DataTables("补偿标准表").dataRows
    Dim nms() As String = {"土地补偿","房屋补偿"}
    For Each nm As String In nms
        For Each c As col  In Tables(nm).cols
            If c.name.StartsWith(dr("补偿物名")) Then
                dr("使用情况")  = True
                Exit For
            End If
        Next
        If dr("使用情况")  = True Then
            Exit For
        End If
    Next
Next


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


加好友 发短信
等级:管理员 帖子:47448 积分:251060 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/7/6 14:45:00 [显示全部帖子]

都用了三年了,为啥总是要别别人全部写好呢?

 

这是代码:

 

For Each dr1 As DataRow In DataTables("补偿标准表").dataRows
    Dim nms() As String = {"土地类","房屋类"}
    For Each nm As String In nms
        For Each dr2 As DataRow In DataTables(nm).DataRows
             If dr1("补偿标准代码") = dr2("补偿标准代码")
                dr1("补偿标准使用情况")  = True
                Exit For
            End If
        Next
        If dr1("补偿标准使用情况")  = True Then
            Exit For
        End If
    Next
Next

For Each dr1 As DataRow In DataTables("项目").dataRows
    Dim nms() As String = {"土地类","房屋类"}
    For Each nm As String In nms
        For Each dr2 As DataRow In DataTables(nm).DataRows
             If dr1("项目代码") = dr2("项目代码")
                dr1("项目代码使用情况")  = True
                Exit For
            End If
        Next
        If dr1("项目代码使用情况")  = True Then
            Exit For
        End If
    Next
Next


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


加好友 发短信
等级:管理员 帖子:47448 积分:251060 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/7/6 16:09:00 [显示全部帖子]

For Each dr1 As DataRow In DataTables("补偿标准表").dataRows
    Dim nms() As String = {"土地类","房屋类"}
    dr1("补偿标准使用情况")  = False
    For Each nm As String In nms
        For Each dr2 As DataRow In DataTables(nm).DataRows
             If dr1("补偿标准代码") = dr2("补偿标准代码")
                dr1("补偿标准使用情况")  = True
                Exit For
            End If
        Next
        If dr1("补偿标准使用情况")  = True Then
            Exit For
        End If
    Next
Next

For Each dr1 As DataRow In DataTables("项目").dataRows
    Dim nms() As String = {"土地类","房屋类"}
    dr1("项目代码使用情况")  = False
    For Each nm As String In nms
        For Each dr2 As DataRow In DataTables(nm).DataRows
             If dr1("项目代码") = dr2("项目代码")
                dr1("项目代码使用情况")  = True
                Exit For
            End If
        Next
        If dr1("项目代码使用情况")  = True Then
            Exit For
        End If
    Next

Next

[此贴子已经被作者于2011-7-6 16:10:30编辑过]

 回到顶部