如何创建包含2个表中的数据并将数据保存到一个表的表单 [英] How to create form that contain data from 2 tables and save data to one table

查看:195
本文介绍了如何创建包含2个表中的数据并将数据保存到一个表的表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2张桌子:

Employee:
    ID
    SalaryPerDay
    Name (unique)
    .....
    .....

Schedule:
    ID
    EmployeeID
    Date
    Attending  (boolean)
    loan
    discount
    overTimeHours

和查询

EmployeeNameQuery: that return all employees names

我创建一个包含的数据表

i create a datasheet contains

column 1: employees names (EmployeeNameQuery)
column 2: Date (Schedule)
column 3: Attening (Schedule)
column 1: OverTimeHours (Schedule)
column 4: Loan (Schedule)
column 5: Discount (Schedule)

此数据表显示员工姓名计数所在的行

this data sheet display rows as employees names count

问题:

1-十进制数显示为(280)如何显示为(280.00)我可以插入十进制数,但是我显示的值为.00而没有.00

1- Decimal number display as (280) how can i display them as (280.00) i can insert decimal number but i display values with .00 without .00

2-如何创建包含2个表中的数据并将数据保存到一个表的表单,

2- How to create form that contain data from 2 tables and save data to one table,

当我填写所有参加的数据表时,我想将这些信息提交给Schedule Table,并将每个字段与表中的相关字段一起提交,并插入所选employeeName的EmployeeID.

when i fill all datasheet with attending i want to submit these information to Schedule Table with each field with related one in the table and insert EmployeeID of selected employeeName.

推荐答案

关于第一个和第二个,看来您没有将表格绑定到表或查询上.仅当所有数据输入控件都绑定到字段时,数据表和连续表格才能正常工作.几乎总是最好使用连续形式而不是数据表.如果您不熟悉表单设计,那么几乎总是最好使用这些向导,因为它们会设置所有绑定到一起来设置表单.

In regard to both one and two, it seems that you have not bound your form to a table or query. Datasheets and continuous forms only work properly if all the data-entry controls are bound to fields. It is nearly always best to use a continuous form rather than a datasheet. If you are not familiar with form design, it is nearly always best to use the wizards, because they will set up the form with all the bindings in place.

对于货币,请选择货币数据类型,而不是小数-这不仅对显示很重要.此外,字段具有可以在表设计中设置的format属性.

For currency, choose the currency data type, not decimal - this is important for more than display. In addition, fields have a format property that can be set in table design.

如果您打算继续在Access中工作,建议您阅读一些内容.您可以在Stackoverflow上找到书籍列表-访问指南经常推荐Getz,Litwin和Baron.

I suggest you do some reading if you intend to continue to work in Access. You will find lists of books here on Stackoverflow - The Access Cookbook Getz, Litwin and Baron is often recommended.

这篇关于如何创建包含2个表中的数据并将数据保存到一个表的表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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