具有扭曲的多参数查询的单一标准 [英] Single Criteria With Multiple Parameter Query With A Twist

查看:56
本文介绍了具有扭曲的多参数查询的单一标准的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有3个字段控件的表单(frm_docs_lookup_list):equip_sr,po_sr,vend_sr


表单的子表单附加到:subfrm_docs_lookup_list


子窗体显示中的结果基于用户输入frm_docs_lookup_list上的控件的文本。子表单中的多个字段指的是3个搜索字段中的每一个。以下列出



equip_sr:标题,装备,备注

po_sr:[PO编号],路径

vend_sr:供应商,制造商


当前的SQL不起作用,因为我使用的标准语句还没有正常工作。我发布了下面我试过的两个版本的声明,并解释了我试图实现的目标是什么?首次尝试
(将相应字段的其他名称替换为vend_sr):


展开 | 选择 | Wrap | 行号

解决方案

我不打算尝试为你编写任何代码,但我会给你一些可能有帮助的建议...


从它的声音来看,你有许多标准可能会或可能不会用于查询。你有三个组合框,可能会或可能不会产生几个过滤器值(我认为)。


停止打包以使一切​​工作一次完成。从第一个框和代码开始。一旦它工作,添加下一个并测试,等等。


此外,它似乎只是将所有这些垃圾塞进查询的标准行。你最好动态生成sql的'WHERE'语句,就像你要求查询中特定的东西一样。


没有组合框,只有文本字段表格。键入其中一个或所有内容的内容会更多地填充查询。在大多数情况下,我可以得到1分。但是当我尝试让任何其他人工作时,它不仅会弄乱第一个,但他们也不会工作。我不知道如何编码你提到的任何东西。我还在学习vba并且还有很多方法


在SQL视图中打开查询并发布...这肯定有助于人们看到你的全部内容做。

I have a form (frm_docs_lookup_list) with 3 field controls: equip_sr, po_sr, vend_sr

the form has a subform attached to : subfrm_docs_lookup_list

the results in the subform display based on what text a user enters in to the controls on "frm_docs_lookup_list". multiple fields in the subform refer to each of the 3 search fields. those are listed below


equip_sr: Title, equip, notes
po_sr: [PO Number], Path
vend_sr: Vendor, Manufacturer


the current SQL doesnt work since the criteria statements I am using dont work right yet. Ill post the 2 versions of the statements Ive tried below, and explain what the goal is Im trying to achieve

first attempt (swap out vend_sr with the other names for the appropriate fields):


Expand|Select|Wrap|Line Numbers

解决方案

I''m not going to attempt to code anything for you, but I will give you some advice that may be helpful...

From the sound of it, you have numerous criteria that may or may not be used in the query. You have three combo boxes that may or may not produce several filter values each (I think).

Stop tyring to make everything work at once. Start with the first box and code for that. Once that is working, add the next one and test for that, etc.

Also, it appears you''re just jamming all this garbage into the criteria line of a query. You''re much better off dynamically generating the ''WHERE'' statement of the sql that way you are asking for something specific in the query.


no combo boxes, just text fields on the form. something typed in to one or all of them fill filter the query more. I can get 1 to work, for the most part. but when I try making any of the others work it not only messes up the first one, but they also dont work. and I dont know how to code any of the stuff you mentioned. Im still learning vba and have quite a ways to go


Open the query in SQL view and post that...it will definitely help for people to see the totality of what you''re doing.


这篇关于具有扭曲的多参数查询的单一标准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆