形成子表单问题 [英] Form sub-form problem

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

问题描述

大家好,我是新手,如果我对问题的描述不清楚,请原谅我。开始。我正在为我的承包公司开发一个新的数据库。我有一个子表单的表单。主表单包含所有客户名称,地址和电话号码,子表单包含每项服务的说明和费用。


我可能需要为每个服务生成3个不同的记录一年的单一客户。当我开始输入新记录的CustomerID时,该客户的最后一条记录将显示在详细信息部分中。我处于一个我只能输入一个客户名称和一个详细部分_____________期间的位置。我确定问题在于属性,但我无法弄明白。我用向导试了一下然后拖放它仍然没有工作。


问候,


史蒂夫

解决方案

你有一个tblDescription表和Company表的KeyField吗?


Nic; o)


您好Nico5038


是的,事实上我是这么做的。我使用电话号码作为客户姓名和地址的唯一标识符,并在说明表中包含了该电话号码字段。顺便说一下,描述表格在数据表视图中。


问候


Steve


< blockquote>我最好使用自动编号作为客户的(无意义)ID,因为电话号码可以更改。

对于其他记录,您可以使用该ID作为 - 称为ForeignKey。

附加记录必须在表中,例如名为tblClientService。

现在这个表将保存ClientID和ServiceID。定义此表时,选择ClientID并按查找按钮。标签。将文本字段更改为表格中的查找并连接字段到tblClient。对可以连接到tblService的ServiceID字段执行相同的操作。


现在添加一个ServiceDate字段,以便能够从此表中分隔行并将多个相同的服务链接到一个客户。最后选择所有三个字段(ClientID,ServiceID和ServiceDate)并按键键。按钮,表示这些形成唯一标识符。


现在您可以为客户端定义一个mainform,并为其他行添加tblClientServiceas子表单。


得到这个想法?


Nic; o)


Hello all, I?m a newbie so please forgive me if my description of the problem is not clear. Here goes. I?m developing a new database for my contracting company. I have a form with a sub form. The main-form has all the customer names, addresses and phone numbers and the sub-form has the descriptions and the cost of each service.

I may need to generate 3 different records per year for one single customer. When I start typing in the CustomerID for a new record the last and only record for that customer appears in the detail section. I?m in a position where I can only enter one customer name and one detailed section _____________period. I?m sure the problem lies in properties but I can?t figure it out. I tried it out with the wizard and drag and drop and it still won?t work.

Regards,

Steve

解决方案

Do you have a tblDescription table with the KeyField of the Company table ?

Nic;o)


Hello Nico5038

Yes as a matter of fact I do. I used the phone number as the unique identifier for customer''s names and addresses and included that very phone number field in the discription table. The discription form is in datasheet view by the way.


Regards

Steve


I''ts better to use an autonumber as the ("meaningless") ID for your clients as a phonenumber can change.
For the additional records you can use that ID as the so-called "ForeignKey".
The additional records will have to be in a table e.g. named tblClientService.
Now this table will hold the ClientID and the ServiceID. When defining this table select the ClientID and press the "Lookup" tab. Change the textfield into a Lookup from a table and "connect" the field to the tblClient. Do the same for the ServiceID field that can be connected to the tblService.

Now add a ServiceDate field to be able to separate the rows from this table and have multiple same Services linked to a Client. Finally select all three fields (ClientID, ServiceID and ServiceDate) and press the "Key" button to indicate that these form the unique identifier.

Now you can define a mainform for the client and add the tblClientServiceas the subform for the additional rows.

Getting the idea ?

Nic;o)


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

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