Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共5 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]后台查询

1楼
ntqhj 发表于:2023/11/27 13:47:00
窗口(外部数据源):TextBox1输入要查的关键字,只对第一列进行后台模糊查找,且只查找包含关键字的最近一条记录,填写到TextBox2中,这个按钮代码该如何写?
2楼
有点蓝 发表于:2023/11/27 13:53:00
dim dr as datarow = datatables("xx表").sqlfind("第一列 like '%" & e.form.controls("TextBox1").text & "%'","[日期] desc")
if dr isnot nothing then
e.form.controls("TextBox2").text = dr("第一列")
endif
3楼
ntqhj 发表于:2024/2/7 16:30:00
老师好!原是access可以用的,现再改成SQL,提示有:'#' 附近有语法错误。应该如何修改啊
Dim Filter As String
With e.Form.Controls("承运车主")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If 
        Filter = Filter & "承运车主 = '" & .Value & "'"
    End If
End With

With e.Form.Controls("StartDate")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "承运日期 >= #" & .Value & "#"
    End If
End With

With e.Form.Controls("EndDate")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "承运日期 <= #" & .Value & "#"
    End If
End With

If Filter > "" Then
    DataTables("承运人明细表").loadFilter = Filter
    DataTables("承运人明细表").load
Else
    DataTables("承运人明细表").loadFilter = ""
    DataTables("承运人明细表").load
End If

4楼
有点蓝 发表于:2024/2/7 16:44:00
参考:http://www.foxtable.com/webhelp/topics/2343.htm
5楼
ntqhj 发表于:2024/2/7 16:54:00
谢谢老师,刚刚查询到了
共5 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03125 s, 2 queries.