以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]后台查询 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=189353) |
-- 作者:ntqhj -- 发布时间:2023/11/27 13:47:00 -- [求助]后台查询 窗口(外部数据源):TextBox1输入要查的关键字,只对第一列进行后台模糊查找,且只查找包含关键字的最近一条记录,填写到TextBox2中,这个按钮代码该如何写? |
-- 作者:有点蓝 -- 发布时间: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
|
-- 作者: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 |
-- 作者:有点蓝 -- 发布时间:2024/2/7 16:44:00 -- 参考:http://www.foxtable.com/webhelp/topics/2343.htm |
-- 作者:ntqhj -- 发布时间:2024/2/7 16:54:00 -- 谢谢老师,刚刚查询到了 |