搜索结果子表单 - 显示使用的条件 [英] Search results subform - display the criteria used

查看:61
本文介绍了搜索结果子表单 - 显示使用的条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个未绑定的表单,其中包含用于输入搜索条件的文本和组合框。单击搜索按钮时,它会构建一个sql语句并将其分配给子表单的记录源。

子表单在页脚中有一个文本框,其中包含=找到的文本框。 &安培; (计数([RecipeName]))& "匹配搜索条件的记录作为它的控制源。

我想通过包含用于获得这些结果的搜索条件来添加到此。我不希望它显示任何空白的文本/组合框。

然后我将它移到标题部分,这样我就可以打印带有结果和标准的子表单用过。

我是一个自学成才的新手(你能告诉......)。您可以在我之前的帖子中看到构成sql的代码。

感谢您的帮助。

I have an unbound form with text and combo boxes for entering search criteria . When Search button is clicked it builds a sql statement and assigns it to the recordsource of a subform.
The subform has in the footer a textbox that has ="found " & (Count([RecipeName])) & " records matching search criteria" as its controlsource.
I want to add to this by including what search criteria has been used to get these results. I don''t want it to display anything for the text/combo boxes that have been left blank.
I will then shift it to the header section so I can print the subform with the results and criteria used.
I am a self-taught access newbie (can you tell..lol). You can see the code that makes up the sql in my previous post.
Thanks for any help.

推荐答案


我有一个带有文本的未绑定表单用于输入搜索条件的组合框。单击搜索按钮时,它会构建一个sql语句并将其分配给子表单的记录源。

子表单在页脚中有一个文本框,其中包含=找到的文本框。 &安培; (计数([RecipeName]))& "匹配搜索条件的记录作为其控制源。
I have an unbound form with text and combo boxes for entering search criteria . When Search button is clicked it builds a sql statement and assigns it to the recordsource of a subform.
The subform has in the footer a textbox that has ="found " & (Count([RecipeName])) & " records matching search criteria" as its controlsource.



到目前为止,非常好。所有在这里都有意义。

So far, so good. All making sense up to here.


我想通过包含用于获得这些结果的搜索条件来添加到此。我不希望它显示任何空白的文本/组合框的内容。
I want to add to this by including what search criteria has been used to get these results. I don''t want it to display anything for the text/combo boxes that have been left blank.



两句话让我想知道你在说什么。

Two sentences which leave me wondering what you''re talking about.


然后我会转移它到标题部分,所以我可以使用结果和标准打印子表单。
I will then shift it to the header section so I can print the subform with the results and criteria used.



根据它的不同,这可能是也可能是不可能的(显然,一个页脚在数据和标题之前出现,所以我们必须看到我们对你的内容有了更好的了解。)

This may or may not be possible depending on what it is (Obviously a Footer comes after the data and a Header before, so we''ll have to see when we have a better understanding of what you''re about.)


你可以在我之前的帖子中看到构成sql的代码。
You can see the code that makes up the sql in my previous post.



如何,没有链接?

如果您认为代码很重要,请添加链接。不管怎样我都不会受伤,但如果你的代码按照你的要求运行,我就看不出它会给你增加太多。

How, without a link?
Please add a link if you think the code is important. It wouldn''t hurt anyway I suppose, but if your code is working as you require, I can''t see that it''s going to add much to this.


你好NeoPa,谢谢你的回复。
Hi NeoPa, thanks for the reply.

两句话让我想知道你在说什么。
Two sentences which leave me wondering what you''re talking about.



Hehe ..你和我两个人在访问时我总是迷惑自己!

Hehe..you and me both when it comes to access I confuse myself all the time!


然后我将它移到标题部分,这样我就可以使用所使用的结果和标准打印子表单。
I will then shift it to the header section so I can print the subform with the results and criteria used.



对不起我觉得这部分真的无关紧要,我试图解释为什么我要做我想做的事。

我似乎已经解决了这个问题,当我构建sql时,我正在以简单的英语构建标准表达式,这将成为我搜索结果的标题。我已经从使用子表单更改结果,而不是自己打开表单(出于各种不相关的原因)。以为我会发布我的代码,以防它帮助其他人:

Sorry I guess this part is irrelevant really, I was trying to explain why I was trying to do what I was trying to do.
I seem to have solved it, I''m building the criteria expression up in plain english when I build the sql, this will become my heading for the search results. I have changed from using a subform for the results, to opening the form on its own instead (for various irrelevant reasons). Thought I''d post my code in case it helps anyone else:

展开 | 选择 | Wrap | 行号


哦亲爱的......我没有'不知道如何正确插入报价! (最初由...发布空白)

对不起。
Oh dear...I haven''t got it sussed how to insert the quotes properly! (Originally posted by..is blank)
Sorry.


这篇关于搜索结果子表单 - 显示使用的条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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