Foxtable(狐表)用户栏目专家坐堂 → 新人再次求教-顺序查找的问题


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

主题:新人再次求教-顺序查找的问题

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


加好友 发短信
等级:八尾狐 帖子:1812 积分:12993 威望:0 精华:14 注册:2008/10/11 18:07:00
  发帖心情 Post By:2019/2/8 10:48:00 [显示全部帖子]

'表B设置DataColChanged事件:


Dim ZHS As List(Of String)
Dim flt1,flt2 As string
Dim n1 As Integer

If e.DataCol.Name = "名称" Then
    If e.DataRow.IsNull("名称") Then
        e.DataRow("序号") = Nothing
    Else
        flt1 = "名称 ='" &  e.DataRow("名称")  & "'"       
        flt2 = flt1 & " And  [_SortKey]  <= " &   e.DataRow("_SortKey")
        ZHS = DataTables("表A").GetValues("序号", flt1)
        n1 = e.DataTable.Compute("Count(名称)",flt2)
        If n1 <= ZHs.Count Then
            e.DataRow("序号") = ZHs(n1-1)
        End If
    End If
End If

 回到顶部