使用一个文本框访问2007搜索多个字段 [英] search multiple fields with one textbox access 2007

查看:57
本文介绍了使用一个文本框访问2007搜索多个字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候所有人,

我仍然是新手,我开始使用Access 2016工作,但我需要将这项工作转移到2007年,而我正在重建从表格(宏)中的搜索按钮出现问题我在访问2016中看起来像是这样的

i am still new to access and i started my work using access 2016 but i needed to transfer this work to access 2007 while i am rebuilding everything from scratch I had a problem with a search button in a form (macro) that used to look like so in access 2016

[商品代码]类似于"*" &安培; [表格]![活动药物清单]![Text126]& " * QUOT;或者[描述]类似于"*" &安培; [表格]![活动药物清单]![Text126]& " *"

[Item Code] Like "*" & [Forms]![Active medication list]![Text126] & "*" Or [Description] Like "*" & [Forms]![Active medication list]![Text126] & "*"

其中Text126是我要输入要搜索的值的字段和[Item Code],[Description]是要搜索的字段。

Where Text126 is the field i am going to enter the values i want to search for and [Item Code] , [Description] is the fields to search in.

我也喜欢使用它来使其更灵活 

Also i used a like to make it more flexible 

但是当我在访问2007中尝试相同时它将无法正常运行 

But when i tried the same in access 2007 it won't work 

以下是解决方案

1。我尝试改变所有"到' 

1. i tried changed all " to '  

2。在开头添加=

3。确保我选择了< value>在表达式构建器中

3. made sure that i selected the <value> in expression builder

在线寻找解决方案没有什么工作我错过了什么?

looked online for solution nothing worked what i am missing?

任何帮助都会受到赞赏的人

Any help would be appreciated guys

推荐答案


问候所有,

Greetings all,

我仍然是新手,我开始使用Access 2016工作,但我需要将这项工作转移到2007年,而我正在从头开始重建一切我的表格中的搜索按钮有问题(宏)以前在访问2016中看起来像这样:

i am still new to access and i started my work using access 2016 but i needed to transfer this work to access 2007 while i am rebuilding everything from scratch I had a problem with a search button in a form (macro) that used to look like so in access 2016

[商品代码]与"*"相似&安培; [表格]![活动药物清单]![Text126]& " * QUOT;或者[描述]类似于"*" &安培; [表格]![活动药物清单]![Text126]& " *"

[Item Code] Like "*" & [Forms]![Active medication list]![Text126] & "*" Or [Description] Like "*" & [Forms]![Active medication list]![Text126] & "*"

其中Text126是我要输入要搜索的值的字段和[Item Code],[Description]是要搜索的字段。

Where Text126 is the field i am going to enter the values i want to search for and [Item Code] , [Description] is the fields to search in.

我也喜欢使用它来使其更灵活 

Also i used a like to make it more flexible 

但是当我在访问2007中尝试相同时它将无法正常运行 

But when i tried the same in access 2007 it won't work 

以下是解决方案

1。我尝试改变所有"到' 

1. i tried changed all " to '  

2。在开头添加=

3。确保我选择了< value>在表达式构建器中

3. made sure that i selected the <value> in expression builder

在线寻找解决方案没有什么工作我错过了什么?

looked online for solution nothing worked what i am missing?

任何帮助都会受到赞赏的人

Any help would be appreciated guys

我找到了解决方法:

1 。我在访问2016中打开了数据库,然后以我知道的方式应用了宏,然后保存了表单。

1. I opened the database in access 2016 then applied the macro the way i know it then saved the form.

2。在Access 2007中打开文件我发现它添加了XmL行。

2. opened the file in access 2007 i found it added XmL lines.

3。我的问题是这里发生了什么以及为什么?我真的需要知道这些Xml衬里添加了什么功能。特别是where子句仍然是相同的

3. my question is what happened here and why? i really need to know what these Xml lined added to the functionality. specially that the where clause is still the same

_AXL:<?xml version =" 1.0"编码= QUOT; UTF-16" standalone =" no"?>
$
< UserInterfaceMacro For =" Command150"事件= QUOT;&的OnClick QUOT; xmlns =" http://schemas.microsoft.com/office/accessservices/2009/11/application">< Statements>< Action Name =" ApplyFilter">< Argument Name =" Where" >

_AXL:<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<UserInterfaceMacro For="Command150" Event="OnClick" xmlns="http://schemas.microsoft.com/office/accessservices/2009/11/application"><Statements><Action Name="ApplyFilter"><Argument Name="Where">

_AXL:eCondition"> [商品代码]类似于"*" &放大器;放大器; [表格]![活跃药物清单]![Text148]& amp; " *"< / Argument>< / Action>< / Statements>< / UserInterfaceMacro>

_AXL:eCondition">[Item Code] Like "*" &amp; [Forms]![Active medication list]![Text148] &amp; "*"</Argument></Action></Statements></UserInterfaceMacro>





这篇关于使用一个文本框访问2007搜索多个字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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