如何在查询旁边的表单中添加复选框以附加到另一个表

发布于 2024-11-28 07:33:23 字数 152 浏览 0 评论 0原文

我正在构建一个培训数据库。我使用的表是:员工、培训课程、培训中和已完成的培训。我有一个查询,可以过滤掉表单以显示尚未接受培训的员工。

我想在结果旁边添加一个复选框,以便我可以选择将其中的部分或全部添加到“训练中”表中。几天来我一直在这个问题上搜索互联网和阅读书籍来寻找答案。

I am building a training database.The tables I am using are: Employees, Training Courses, In Training, and Completed Training. I have a query that filters off of a form to show employees that have not received the training.

I want to add a checkbox next to the results so I can select some or all of them to be added to the In Training table. I have been stuck on this for days searching the internet and reading books looking for the answer.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

二智少女 2024-12-05 07:33:23

刚看到这个问题。这是此问题的替代解决方案。没有复选框,但您会得到一个带有组合框的子表单,用于更新特定员工的课程和进度。

  1. 创建 4 个表,其中包含以下字段:

    • tbl员工
      • EmployeeID(主键)
      • EmployeeName(以及您可能需要的任何其他字段)
    • tblProgress->这将“IN TRAINING”、“COMPLETED”存储为 2 个单独的记录
      • ID(自动编号)(主键)
      • 进度描述
    • tbl培训课程
      • 课程 ID(主键)
      • 课程名称
    • tblEmployeeTraining ->这里我们使用复合键
      • EmployeeID(主键)
      • 课程 ID(主键)
      • 进展
  2. 在 tblEmployees 和 tblEmployeeTraining 之间创建一对多关系,链接 EmployeeID。

  3. 通过从“数据类型”列中选择“查找向导...”,在 tblEmployeeTraining(在设计视图中)中配置以下字段。

    • 课程ID
      • 选择 tblTrainingCourses 作为查找值的表格
    • 进展
      • 选择 tblProgressas 作为查找值的表格
  4. 根据 tblEmployees 创建一个表单。您应该获得一个包含的子表单,其中将显示课程名称和进度。基本上,子表单中的两列将显示组合框,供您选择课程和进度。


如果您不想要步骤2中的关系,也许您想在删除员工数据后存储员工数据,那么您需要创建一个查询并将其用作子表单的RecordSource。您可能希望在 tblEmployees 中添加一个字段来确定员工是否处于活动状态,而不是从 tblEmployees 中删除记录。然后,您可以使用上述步骤,只需在表单上进行过滤即可显示那些活跃员工。

Just saw this question. Here is an alternative solution to this problem. There is no checkbox, but you get a subform with combo box to update the course and progress for a particular employee.

  1. Create 4 tables with the fields:

    • tblEmployees
      • EmployeeID (Primary Key)
      • EmployeeName (and any additional fields you might need)
    • tblProgress -> this stores "IN TRAINING", "COMPLETED" as 2 separate records
      • ID (AutoNumber) (Primary Key)
      • ProgressDesc
    • tblTrainingCourses
      • CourseID (Primary Key)
      • CourseName
    • tblEmployeeTraining -> here we are using composite key
      • EmployeeID (Primary Key)
      • CourseID (Primary Key)
      • Progress
  2. Create a one-to-many relationship between tblEmployees and tblEmployeeTraining, linking the EmployeeID.

  3. Configure the following fields in tblEmployeeTraining (in Design View), by selecting the [Lookup Wizard...] from Data Type column.

    • CourseID
      • Choose the tblTrainingCourses as the table for the Lookup Values
    • Progress
      • Choose the tblProgressas as the table for the Lookup Values
  4. Create a Form based on the tblEmployees. You should get a subform included that will display the Course Name and Progress. Basically, the 2 columns in the subform will show combo box for you to select the course and the progress.


If you do not want the relationship in step 2, maybe you want to store the employee data after it is deleted, then you need to create a query and use it as the RecordSource for the subform. Instead of deleting the record from tblEmployees, you may want to add a field in tblEmployees to determine if the employee is active or not. Then, you can use the above steps and just do filtering on the form to display those active employees.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文