以父表单创建新记录的按钮 [英] Create button for new record in parent form

查看:58
本文介绍了以父表单创建新记录的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!


我没有使用Access或一般VBA编程的经验,所以我需要问你这个:


我''在Access 2007中为保险办公室创建一个新的DBase。我创建了3个级别的表:

客户(祖父母),合同(父母),付款(子)。通讯表格包含相关的子表格。我正在向您发送Access 2007文件以进行检查。


我正在寻找的是在父表单中创建一个按钮(例如CustomersBrowse),它将通过表单使用创建一个新的子记录(例如ContractsNew)。我真正需要的是在ContractsNew表单打开时,继承Customer字段(已打开子表单)中的ID_Customer(父表单)。


有办法吗?

(我很抱歉DBase中的希腊语,这是我的母语)



Hello!

I don''t have experience in programming in Access or generally VBA, so I need to ask you this:

I''m creating a new DBase in Access 2007, for an insurance office. I have created 3 levels of tables:
Customers (grandparent), Contracts (parent), Payments (child). The correspondent forms contain the related subforms. I''m sending you the Access 2007 file to check it out.

What I ''m looking for, is to create a button in the parent form (eg CustomersBrowse), that will create a new child record by form use (eg ContractsNew). What I actually need is when the ContractsNew form opens, to inherit the ID_Customer (of the parent form) in the Customer field (of the opened child form).

Is there a way to do it?
(I ''m sorry for the greek language in the DBase, it''s my mother language)

附加文件
Insurance office.zip (142.5 KB,139 views)
Attached Files
Insurance office.zip (142.5 KB, 139 views)

推荐答案

Kaire!


加菲猫,是的,什么你要求的很有可能。我能提供的最简单的解决方案就是如果你正确地创建表单,这应该是自动的。


你的主表单将把Customers表作为其记录源。其中一个字段应该是ID_Customer。在First子窗体上,只需确保窗体的'Master-Child字段是ID_Customer。如果是这种情况,每次为客户创建新合同时,客户ID都应转换为新表。


同样适用于付款子表单(我假设将是嵌入式他合同子表单。这应该可以解决问题。


如果遇到任何障碍,请告诉我们。
Kaire!

Garfield, Yes, what you are asking for is very possible. The easiest solution I can provide is simply that if you create your Forms correctly, this should be automatic.

Your main form would have the Customers table as its record source. One of the fields should be ID_Customer. On the First subform, just make sure that the forms'' Master-Child field is ID_Customer. If this is the case, every time you create a new contract for the Customer, the Customer ID should translate to the new Table.

Likewise for the Payments Subform (which I assume will be embedded int he Contracts Subform. This should do the trick.

Let us know if you come across any snags.


我知道它是可能通过子窗体(在我使用Access之前,我使用的是FileMaker - 脚本编写起来相当容易)。


有没有办法通过弹出窗体来实现,由a调用按钮?


我找到了一些方法,但我不能将它们调整到我的DBase。
http://bytes.com/topic/access/answer...orm-new-record
I know that it was possible through the subform (before I use Access, I was using FileMaker - it was quite easier in scripting).

Is there a way to do it through a popup form, called by a button?

I ''ve found some ways, but I can''t adjust them to my DBase.
http://bytes.com/topic/access/answer...orm-new-record


我想使用表单/子表单设计的易用性,我不得不问是否有必要使用单独的表单。是的,它可以这样做,但如果你没有使用Access和VBA的经验,那么这不是我要开始的地方。即使有经验,我仍然会推荐表单/子表单构造,因为它很容易,并且没有必要的结构。 VBA让它发挥作用。


我们可以根据你的需要努力去做,但这取决于你对复杂性的满意程度。
I guess with the ease of use of using form/sub-form design, I would have to ask if it was necessary to use a separate form. Yes, it is possible to do it that way, but if you don''t have experience using Access and VBA, then that is not the place I would start. Even with experience, I would still recommend the form/sub-form construction, simply because of its ease, and there is no "necessary" VBA to make it work.

We can work toward doing it however you desire, but it depends on how comfortable you are with complexity.


这篇关于以父表单创建新记录的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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