如何返回具有多个值的字段的搜索结果? [英] How do I return search results for a field with multiple values?

查看:80
本文介绍了如何返回具有多个值的字段的搜索结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Access 2002.


我有一个查询字段设置引用一个表单Policy_File_Inventory,它有一个未绑定的字段,BarcodeNumber。


表单有几个与BarcodeNumber字段相关的选项。我对选择第四个选项时会发生什么感兴趣。 (第一个和第二个选项工作正常。第三个选项只显示所有记录。)

I''m using Access 2002.

I have a query field set up that references a form, Policy_File_Inventory, that has an unbound field, BarcodeNumber.

The form has several options related to the BarcodeNumber field. I am interested in what happens when the fourth option is selected. (The first and second selections work fine as is. The third option just displays all records.)

< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号

推荐答案

我很乐意帮忙,但你不能解释你可能正在使用的任何桌子的数据结构(你也没有解释过)。

显然你已经在这个问题上投入了一些精力,但遗憾的是遗漏了一些重要的信息,没有这些信息,你很难理解你想要的东西。
I''d love to help, but you don''t explain the data structure of any tables you are probably using (You haven''t explained that either).

Clearly you''ve put some effort into the question, but unfortunately left out some critical info, without which it''s really hard to understand what you''re trying to ask for.


我试着不写一本书,我不确定你究竟需要知道什么,但这里有我所知道的一切:


这里只使用了一个表。

每个记录都有一个AutoID,BoxBarcode和FileBarcode。有些记录有ChildBarcode。一些记录在ChildBarcode字段中有逗号和空格分隔的多个条形码。

我很确定字段是文本。


那里' '使用AutoID,BoxBarcode,FileBarcode和ChildBarcode字段的查询。查询中的最后一个字段包含上面的代码。


有一个包含BoxBarcode,FileBarcode和ChildBarcode字段的子表单。


有一种形式,Policy_File_Inventory,其[Frame 4]有4个选项。表单还有用户输入数据的[BarcodeNumber]未绑定字段。表单显示子表单。


第一个选项是输入新记录。选择此选项后,子窗体中最初不会显示任何记录。用户将BoxBarcode输入到表单中的BarcodeNumber字段,光标移动到子表单中的FileBarcode字段。输入FileBarcodes时,会创建新记录,每个记录都有相同的BoxBarcode。


第二个选项是在BoxBarcode字段中搜索与在BarcodeNumber字段中输入的字符串匹配的任何记录。表单。


第三个选项是显示表中的所有记录。


第四个选项是搜索FileBarcode字段或ChildBarcode任何与在表单中的BarcodeNumber字段中输入的字符串匹配的记录的字段。


实际上,如果记录的ChildBarcode字段是12345,那么然后我输入12345,它返回我想要的记录。

但是如果记录的ChildBarcode字段是12345,54321,我希望能够在记录时提取该记录我搜索12345当我搜索54321时......我不知道该怎么做。
I was trying not to write a book, and I''m not sure what exactly you need to know, but here''s everything I know:

There''s only one table in use here.
There''s an AutoID, BoxBarcode, and FileBarcode for each record. Some records have a ChildBarcode. A few records have multiple barcodes separated by a comma and space in the ChildBarcode field.
I''m pretty sure the fields are text.

There''s a query with the AutoID, BoxBarcode, FileBarcode, and ChildBarcode fields. The last field in the query has the code above.

There''s a subform that has the BoxBarcode, FileBarcode, and ChildBarcode fields.

There''s a form, Policy_File_Inventory, that has the [Frame 4] that has 4 options. The form also has the [BarcodeNumber] unbound field that users input data in. And the form displays the subform.

The first option is to enter new records. When this option is selected, no records initially appear in the subform. The user enters a BoxBarcode into the BarcodeNumber field in the form and the cursor moves to the FileBarcode field in the subform. As FileBarcodes are entered, new records are created, each with the same BoxBarcode.

The second option is to search the BoxBarcode field for any records matching the string entered in the BarcodeNumber field in the form.

The third option is to display all the records in the table.

The fourth option is to search the FileBarcode field or ChildBarcode field for any records matching the string entered in the BarcodeNumber field in the form.

As it is, if the ChildBarcode field for a record is "12345" and I enter "12345", it returns the record I want.
But if the ChildBarcode field for a record is "12345, 54321", I want to be able to pull up that record when I search for "12345" and when I search for "54321"... and I have no idea how to do that.


这被建议作为我代码结尾的替代品:
This was suggested as a replacement for the end of my code:
展开 | 选择 | Wrap | 行号


这篇关于如何返回具有多个值的字段的搜索结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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