强制主表单和子表单的数据输入 [英] Force data entry of Main form AND sub form

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

问题描述

我正在使用Windows 8中的Access 2013

由于我为了使另一个表单工作所做的更改,我创建了一个不同形式的新问题。


我有2张桌子

表1 =父母

表2 =孩子


父表必须至少有一个孩子。


在我的表单上,我试图找出如何阻止主表单关闭或转到新记录,除非子表也创造了一条记录。


我尝试了许多失败的方法。


我一直专注于关闭按钮的事件。一旦这个工作,我将把它包含在我的新记录按钮中。我有表单设置,所以这些按钮是关闭或获取新记录的唯一选项。


我的研究没有给我足够的信息来完成这项工作。每次我尝试查看子表单时都会收到以下错误....


错误消息:对象不包含Automation对象''表单。''您试图运行Visual Basic过程来为对象设置正确的方法。但是,组件不会使属性或方法可用于自动化操作。


''Forms''被我试过的子表单控件取代。此错误来自于尝试在宏中使用If语句:

I am working with Access 2013 in Windows 8

Due to changes I made to make another form work, I have created myself a new problem with a different form.

I have 2 tables
Table 1 = parent
Table 2 = child

The parent table must have at least 1 child.

On my form, I am trying to figure out how to prevent the main form from closing or going to a new record unless the sub has also created a record.

I have tried numerous methods that have failed.

I have been focused on an event for my close button. Once this is working I will include it with my new record button. I have the form set so these buttons are the only option to close or get a new record.

None of my research has given me enough information to make this work. Every time I try to get an event to look at the sub form I receive the following error....

Error Message: The object doesn''t contain the Automation object ''Forms.'' You tried to run a Visual Basic procedure to set a proper or method for an object. However, the component doesn''t make the property or method available for Automation operations.

''Forms'' is replaced with what ever control of the sub form I have tried. This error was from attempting to use an If statement in a macro:

展开 | 选择 | Wrap | 行号

推荐答案

我没有得到你真正想要的东西,但是我明白了什么

是你在主表单子表单中创建新记录时想要获得
得到一个新纪录

实际上我看不出问题出在哪里

ms访问将在你创建主要版本时创造新纪录

你可以尝试进行查询然后创建表单,那就是's t。
Hi ,I didn''t get what you wan''t really but what I have understand
is that you trying to
when create new record in the main form sub form get a new record
and actually I can''t see where is the problem is
ms access will make new record when you make one on the main
you can try to make query then create form to it ,and that''s it.


除非我在子表单中输入数据,否则我的访问表单不会在子表单中创建新记录。


如果在主窗体中输入数据,然后在将任何内容输入子窗体之前关闭窗体(或转到新记录),那么表2中没有子记录与表1中创建的记录相关。


我想知道这对你有用。


谢谢
My access form is not creating a new record in the sub form unless I enter data in the sub form.

If data is entered in the main form and then the form is closed (or goes to a new record) before entering anything into the subform, then I have no child record in table 2 related to the record created in table 1.

I would like to know how this works for you.

Thanks


你能告诉我你在使用什么,表格形成或查询表格吗?

如果它是查询形式我相信你的查询有问题你能写下你做了什么.. @!
can you please tell me what are you using, table to form or query to form ??
if it''s query to form I believe that there is problem in your query can you write what did you do..@!


这篇关于强制主表单和子表单的数据输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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