以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  filter 最近10条记录  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=97305)

--  作者:jncoser
--  发布时间:2017/3/9 16:00:00
--  filter 最近10条记录
Dim ezch As WinForm.TextBox = e.Form.Controls("账车号") 
Dim drs As List(Of DataRow)
Dim filter As String
drs = DataTables("明细").Select("车号 =\'" & ezch.Value & "\'")
For Each dr As DataRow In drs
        If filter = "" Then
            filter = "批号=\'" & dr("批号") & "\'"
        End If
      filter = filter & " Or " & "批号=\'" & dr("批号") & "\'"
Next
Tables("查询_查询表").filter= filter 
上面代码按车号查找相应批号并显示表,如果想显示最近10次批号记录,求解。有日期列。


--  作者:有点色
--  发布时间:2017/3/9 16:55:00
--  
Dim ezch As WinForm.TextBox = e.Form.Controls("账车号")
Dim drs As List(Of DataRow)
Dim filter As String
drs = DataTables("明细").Select("车号 =\'" & ezch.Value & "\'", "日期 desc")
Dim count As Integer = 0
For Each dr As DataRow In drs
    If count >= 10 Then
        Exit For
    End If
    count += 1
    If filter = "" Then
        filter = "_Identify=" & dr("_Identify") & ""
    End If
    filter = filter & " Or " & "_Identify=\'" & dr("_Identify") & "\'"
Next
Tables("查询_查询表").filter= filter

--  作者:jncoser
--  发布时间:2017/3/9 17:10:00
--  
理解了 谢谢。