表单上的复选框以运行查询 [英] checkboxes on form to run query

查看:69
本文介绍了表单上的复选框以运行查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要有关表单复选框的帮助。我在一个表中有17个类别,在字段中有日期。我希望有一个包含17个复选框的搜索表单,以便用户可以选中复选框以获取日期,或者选中多个复选框以使相应类别具有多个日期。例如,一个类别是红色培训,一个类别是蓝色培训,一个类别是白色培训,所有都有完成日期。在表格上,我检查红色培训,并获得所有完成红色培训并显示日期的人的姓名,并且不显示其他培训,或者我检查红色和蓝色培训,给我姓名和完成的日期。感谢任何可以提供帮助的人。

解决方案

可能不是处理事情的最佳方式。当添加第18类时会发生什么 - 完全重新设计。

#I会建议基于您的类别的多选列表框(这个数字是无关紧要的)


然后根据列表框中的ItemsSelected构建一个条件,并将其作为过滤器应用。


对不起,这有点模糊,但更多信息在你的桌面结构上会有所帮助。


Phil


恕我直言:您的数据库现在可以重新设计:
数据库规范化和表格结构


在标准化下,你很可能应该有一个表持有员工信息,一个表持有培训类别,第三个表将两个表与日期联系起来。


您仍然可以使用Phil提出的多选列表框或其他方法是使用s ubforms,例如有父,子,孙子安排(在这里看到图像 :)与父级别的员工,作为子项的类别和作为孙子的日期...或者只是作为员工的父级和具有日期作为子级的类别子窗体。或者从长远来看,许多其他设计会更有效地维护您的数据。


表结构:

展开 | 选择 | Wrap | 行号

Need help with checkboxes on form. I have 17 categories in a table with dates in the fields. I want to have a search form with 17 checkboxes so a user can check a checkbox to get the date, or check more than one checkbox to have multiple dates for the corresponding category. for example, one category is red training, one category in blue training, one category is white training all with dates of completion. on the form I check red training and get the name of all people who completed red training and show the date, and does not show the other training, or I check red and blue training, gives me the name and the dates completed. Thanks for anybody who can help.

解决方案

Probably not the neatest way of handling things. What happens when the 18th category gets added - a complete re-design.
#I would suggest a multi-select listbox based on your categories (that way the number is irrelevant)

You then build a criteria based on the ItemsSelected from your list box and apply that as a filter.

Sorry this is a bit vague, but a little more information on your table structure would help.

Phil


IMHO: your database could use a redesign now:
Database Normalization and Table Structures

Under normalization you most likely should have one table holding the Employee information, one table holding the category of training and a third table that relates the two tables with dates.

You can still use a multiselect List box as Phil has suggested or another approach is to use subforms, for example have a Parent, Child, Grandchild arrangement (see image here:) with the Employee at the Parent level, the Categories as the Child and Dates as the grandchild... or just parent as the Employee and the Category with dates as the Child subform. Or a multitude of other designs that in the long run would make upkeep on your data much more efficient.


Table Structure:

Expand|Select|Wrap|Line Numbers


这篇关于表单上的复选框以运行查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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