表格过滤 [英] Form Filtering

查看:81
本文介绍了表格过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!


我只想询问是否可以对表单中的记录进行多次搜索/过滤?


例如,我有一个表单(frmApplications),它有一个连接到表的记录源(tblApplications)。然后我想查看和编辑App_Num等于5299672017819116,5299671118593117,5299671606423116等的记录,依此类推。 MS ACCESS的过滤功能只允许我逐个查看和编辑过滤的记录。有没有办法可以在一个表格中查看和编辑App_Nums的所有这些过滤记录(希望是连续表格)?


非常感谢你:))

解决方案




简短的回答是肯定的,但是我们需要知道你打算如何为所需的App_Num imp过滤器。


例如,你可以有一个多选列表框和一个按钮来应用过滤器,这将根据代码中的选定项目构建过滤条件,然后将其应用于形式。


这当然需要一些VBA知识!


还有其他方法可以做到这一点,也许你可以指出你是怎样的看它运作。


MTB


首先让我说你已经同时发布了两个非常相似的线程(< a href =http://bytes.com/topic/access/answers/931646-how-do-i-open-form-multiple-items-filteredtarget =_ blank>如何打开表单过滤多个项目)。由于存在相当大的重叠,我认为这是一种弄巧成拙的方法。我现在将删除其他问题,而过滤问题的主要概念在此处理。如果,在那时,你觉得你想要问这些概念是否打开一个预先过滤到你选择的单独表格,那么你应该从更好理解的位置那样做。


就同一形式的过滤而言,需要处理两个基本问题:

  1. 如何提供
  2. 如何根据该列表过滤记录。



MTB已经提供了一些想法A,考虑到有限列表可以从中选择值,这似乎是明智的。如果不是这种情况,则允许输入由逗号(,)等字符分隔的项目列表的简单TextBox控件将是可行的替代方案。


用于过滤您可以在表格上的示例过滤< / A>。它甚至有一个下载和试验的示例数据库,并解释了如何在过滤器字符串中格式化各种类型的数据。


大家好!感谢回复!首先,我承认我是访问和VBA编码的新手,所以请原谅我。 :D


@MikeTheBike - 我实际上可以看到表单有多个文本框,我可以在其中输入我想要找到的不同的App_Num。然后单击一个按钮,我只想看到我输入的记录。 (如果它应该是在同一个表单上并不重要)但我希望它可编辑而不是在查询中(因为我认为查询仅用于查看)。 :)


@NeoPa - 对不起其他帖子。我仅仅因为我认为发现另一个更难以理解而重新发布这个问题。感谢您指导我阅读一篇文章。我会尝试阅读并理解这一点,也许这可以回答我的问题。 :)

Hi!

I just want to ask if it is posible to make a multiple search/filter of records in a form?

For example, I have a form(frmApplications) that has a record source connected to a table (tblApplications). Then I want to view and edit records which App_Num are equal with "5299672017819116", "5299671118593117", "5299671606423116", and so on. Filter feature of MS ACCESS only allows me to view and edit filtered records one by one. Is there a way I can view and edit all these filtered records of App_Nums in one form(hopefully in a Continuous Form)?

Thank you so much :)

解决方案

Hi

The short answer is yes, but we would need to know how you intend to impliment the filter for the required App_Num''s.

For instance, you could have a multi-select list box and a button to apply the filter, which would build a filter criteria from the selected items in code and then apply it to the form.

This would of course require some VBA knowlege!

There are other ways to do this, perhaps you could indicate how you see it operating.


MTB


First let me say that you have posted two very similar threads at the same time (How do I Open a Form with Multiple Items Filtered). As there is considerable overlap I suggest this is a self-defeating approach. I will delete the other question for now while the main concepts of the filtering issue are dealt with in here. If, at that point, you feel you''d like to ask about applying those concepts to opening a separate form pre-filtered to your choices, then you should do that then, from a position of better understanding.

As far as filtering within the same form goes, there are two fundamental issues you need to deal with :

  1. How to provide an interface that enables multiple items to be input.
  2. How to filter the records based on that list.


MTB has already offered some thoughts on A, which seem sensible given a finite list from which to choose values. If that is not the case then a simpler TextBox control allowing the entry of a list of items separated by a character such as a comma (,) would be a viable alternative.

For filtering within and between forms you can find all you need at Example Filtering on a Form. It even has an example database to download and experiment with, and explains how various types of data should be formatted in the filter string.


Hi guys! Thanks for replying! First of all, I admit that I''m new at access and VBA coding so please forgive me. :D

@MikeTheBike - I actually visualize the form to have multiple textboxes where I could input different App_Num''s I want to find. Then with a click of a button, I want to see only the records which I have input. (doesn''t really matter if it should be on the same form or not) But I want it editable and not in a query(since I believe queries are only for viewing). :)

@NeoPa - Sorry for the other thread. I repost this question simply because I thought I found the other one more difficult to understand. Thank you for directing me to an article. I would try to read and understand that and maybe that could answer my question. :)


这篇关于表格过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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