windows 如何在列标题中包含工作日和日期的 Microsoft Access 2007 中安排每日时间日志条目表单

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7509652/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 18:08:01  来源:igfitidea点击:

How to arrange a daily time log entry form in Microsoft Access 2007 with Weekdays & Dates in the column headings

databasewindowsformsms-accessms-access-2007

提问by Byron

The objective is to create a weekly form, in Microsoft Access 2007, that allows employees to select their name from a list, the date of the first day of the week, and then create all daily time longs for the week in single form. The form needs to have a week view like the form (an Excel mockup) shown here:

目标是在 Microsoft Access 2007 中创建一个每周表单,允许员工从列表中选择他们的姓名、每周第一天的日期,然后以单一表单创建该周的所有每日时间长度。表单需要像此处显示的表单(Excel 模型)一样具有周视图:

enter image description here

在此处输入图片说明

Once entered, the data is to be written to the Project Time Log table shown here:

输入后,数据将写入此处显示的项目时间日志表:

enter image description here

在此处输入图片说明

When the employee selects the "Week Starting" value, the column headings in the able below need to update. Is this possible? What also has me stumped is how to enter project hours for the week in a single row that will result in creating up to 6 records in my database. Finally, how does one set up validation on the "Week Starting" field so that the employee can only select Mondays?

当员工选择“周开始”值时,下方表格中的列标题需要更新。这可能吗?同样让我感到困惑的是如何在一行中输入一周的项目时间,这将导致在我的数据库中创建多达 6 条记录。最后,如何在“周开始”字段上设置验证,以便员工只能选择星期一?

I guess this is where I admit that I am just getting started with MS Access. However, with some experience in database design and Excel I am finding everything but advanced form building to be fairly straightforward.

我想这就是我承认我刚刚开始使用 MS Access 的地方。但是,凭借在数据库设计和 Excel 方面的一些经验,我发现除了高级表单构建之外的所有内容都相当简单。

So, can someone point me in the right direction? Do I need to use a Pivot Table to make this work? What is a Modal Dialogue? Could it be useful here? Any suggestions would be greatly appreciated.

那么,有人可以指出我正确的方向吗?我是否需要使用数据透视表来完成这项工作?什么是模态对话?在这里有用吗?任何建议将不胜感激。

回答by Fionnuala

The easiest way may be to create a table used solely for dataentry that can reside in the front-end for each employee.

最简单的方法可能是创建一个单独用于数据输入的表,该表可以驻留在每个员工的前端。

DETable

EmployeeID
WeekStarting
ProjectID
Workcode
Mon
Tue
<...>
Sat

You can clear down the table and then append the relevant projectIDs and EmployeeID with a command button or suitable event.

您可以清除该表,然后使用命令按钮或合适的事件附加相关的 projectID 和 EmployeeID。

The labels showing Mon, Tue etc can be updated to show the relevant date after WeekStarting is selected.

显示 Mon、Tue 等的标签可以在选择 WeekStarting 后更新以显示相关日期。

A suitable set of queries, or a UNION query will allow you to append the data to the main table.

一组合适的查询或 UNION 查询将允许您将数据附加到主表。