以文本方式查看主题

-  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=63430)

--  作者:tungwun
--  发布时间:2015/1/20 22:12:00
--  [求助]
 这代码可用司机编号直接查询司机资料,请问如何加入查询(未付款)未付款列,最後10行

Dim Filter As String
With e.Form.Controls("TextBox7")
If .text IsNot Nothing Then
Filter = "司機編號  = \'" & .text & "\'"
 End If
End With
If Filter > "" Then
Tables("車租更表").Filter = filter
End If
With Tables("車租更表") 
.Position = .Rows.Count - 1
End With

--  作者:有点甜
--  发布时间:2015/1/20 22:26:00
--  

这个意思?

 

Filter = "司機編號  = \'" & .text & "\' And 未付款 = true"

 

或者

 

Filter = "司機編號  = \'" & .text & "\' And 付款 = \'未付款\'"


--  作者:tungwun
--  发布时间:2015/1/20 22:48:00
--  [求助]
这代码可用Filter = "司機編號  = \'" & .text & "\' And 付款 = \'未付款\'"
请问如可加入只显示最前10行,未付款行?

--  作者:有点甜
--  发布时间:2015/1/20 23:58:00
--  

Dim drs As List(Of DataRow) = DataTables("表A").Select("司機編號  = \'" & e.Form.Controls("TextBox7").Text & "\' And 付款 = \'未付款\'")
Dim idxs As String = ""
Dim count As Integer = 0
For Each dr As DataRow In drs
    If count >= 10 Then
        Exit For
    Else
        idxs &= dr("_Identify") & ","
    End If
Next

Tables("表A").Filter = "_Identify in (" & idxs.trim(",") & ")"


--  作者:tungwun
--  发布时间:2015/1/21 14:13:00
--  [求助]
代码有个错误
图片点击可在新窗口打开查看此主题相关图片如下:sshot-1.png
图片点击可在新窗口打开查看
请问可否显示未付款前10行,现在是显示後10行?

--  作者:Bin
--  发布时间:2015/1/21 14:15:00
--  
Select 有排序函数 http://www.foxtable.com/help/topics/0400.htm

筛选前判断一下IDXS为空不执行
if idxs <> "" then
Tables("表A").Filter = "_Identify in (" & idxs.trim(",") & ")"
end if

--  作者:tungwun
--  发布时间:2015/1/21 14:41:00
--  请问可否显示未付款前10行,现在是显示後10行?
请问可否显示未付款前10行,现在是显示後10行?
--  作者:Bin
--  发布时间:2015/1/21 14:44:00
--  
Select 有排序函数 http://www.foxtable.com/help/topics/0400.htm
--  作者:tungwun
--  发布时间:2015/1/21 14:53:00
--  [求助]
请问如何加在这代码卡?

im drs As List(Of DataRow) = DataTables("表A").Select("司機編號  = \'" & e.Form.Controls("TextBox7").Text & "\' And 付款 = \'未付款\'")
Dim idxs As String = ""
Dim count As Integer = 0
For Each dr As DataRow In drs
    If count >= 10 Then
        Exit For
    Else
        idxs &= dr("_Identify") & ","
    End If
Next

Tables("表A").Filter = "_Identify in (" & idxs.trim(",") & ")"




--  作者:Bin
--  发布时间:2015/1/21 14:55:00
--  
请问你有看帮助吗?
DataTables("表A").Select("司機編號  = \'" & e.Form.Controls("TextBox7").Text & "\' And 付款 = \'未付款\'","你要排序的列 Desc")