以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]如何查询符合条件的下一行  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=118054)

--  作者:cool314156
--  发布时间:2018/4/24 10:53:00
--  [求助]如何查询符合条件的下一行
Dim Filter As String
Dim r As Integer
With e.Form.Controls("cmbProduct")
    If .Value IsNot Nothing Then
        Filter = "批号 like \'%" & .Value & "%\'"
Dim dr As DataRow
dr = DataTables("管理").Find(Filter)
If dr IsNot Nothing Then
    Dim wz As Integer = Tables("管理").FindRow(dr)
    If wz >= 0 Then
        Tables("管理").Position = wz
    End If
End If
End If
End With
我用这个代码查询符合条件的行,只会定位到复核条件的第一行,请教下要如何写代码,可以点击按钮循环找到符合条件的行,

--  作者:有点甜
--  发布时间:2018/4/24 12:02:00
--  
Dim Filter As String
Dim r As Integer
With e.Form.Controls("cmbProduct")
    If .Value IsNot Nothing Then
        Filter = "批号 like \'%" & .Value & "%\'"
        Dim t As Table = Tables("管理")
        Dim wz As Integer = t.FindRow(filter, t.Position+1, True )
        If wz >= 0 Then
            t.Position = wz
        End If       
    End If
End With

--  作者:cool314156
--  发布时间:2018/4/24 12:20:00
--  
谢谢老师