以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- sql下拉框怎么写 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=142990) |
-- 作者:巷弄太过弯曲 -- 发布时间:2019/11/11 13:11:00 -- sql下拉框怎么写 老师,如图我有一个表控件使用SQL代码生产的,我现在想要在单据编号,供应商的下拉框能过滤出表中的数据。列如供应商选中a 过滤出来都是供应商A的数据 请问这个怎么写,SQL小白一枚 刚刚学习中 表控件SQL为: Dim cmd As New SQLCommand Dim dt As DataTable cmd.C cmd.CommandText = "SE LEC T fbillno as 单据编号,{t_Supplier}.Fname as 供应商 ,{POOrder}.fdate as 日期 ,{t_Department}.FName as 部门,{t_ICItem}.fname as 物料名称,{t_ICItem}.FModel as 规格型号,{t_MeasureUnit}.fname as 单位 ,{t_Currency}.Fname as 币别,{POOrderEntry}.FQty as 数量,{t_emp}.FName as 业务员, b.fname as 制单人 ,{t_user}.fname as 审核人, {POOrder}.FCheckDate as 审核时间 From (((((((({POOrder} left join {t_Supplier} on {POOrder}.FSupplyID = {t_Supplier}.FItemID) left join {t_Department} on {POOrder}.FDeptID = {t_Department}.FItemID) inner join {POOrderEntry} on {POOrder}.FInterID = {POOrderEntry}.FInterID) inner join {t_ICItem} on {POOrderEntry}.FItemID = {t_ICItem}.FItemID) inner join {t_MeasureUnit} on {t_ICItem}.FUnitID = {t_MeasureUnit}.FMeasureUnitID) inner join {t_emp} on {POOrder}.FEmpID = {t_emp}.fitemid) inner join {t_Currency} on {POOrder}.FCurrencyID = {t_Currency}.FCurrencyID) left join {t_User} on {POOrder}.fcheckerid = {t_User}.FUserID) left join {t_User} b on {POOrder} .FBillerID = b .FUserID " dt = cmd.ExecuteReader() Tables("窗口1_Table1").DataSource = dt Tables("窗口1_Table1").DataTable.DataCols("数量").Decimals = 1 Tables("窗口1_Table1").DataTable.DataCols("数量").SetFormat("0.0") Tables("窗口1_Table1").AutoSizeCols() \'自动列宽 |
-- 作者:有点蓝 -- 发布时间:2019/11/11 13:36:00 -- 查询按钮用法参考:http://www.foxtable.com/webhelp/topics/1058.htm Dim Filter As String With e.Form.Controls("供应商") If .Value IsNot Nothing Then Filter = "供应商 = \'" & .Value & "\'" End If End With If Filter > "" Then
Tables("窗口1_Table1").Filter = Filter End If [此贴子已经被作者于2019/11/11 13:37:11编辑过]
|
-- 作者:巷弄太过弯曲 -- 发布时间:2019/11/11 16:15:00 -- 老师,可以了,我还有一个问题,如图,列如怎么样可以做到在供应商组合框中输入“北”字,就自动过滤出供应商名中有“北”的供应商名称 |
-- 作者:有点蓝 -- 发布时间:2019/11/11 16:16:00 -- 参考:http://www.foxtable.com/webhelp/topics/0943.htm |