简体   繁体   English

通过vba更新Mainform上的子表单时,MS Access数据库也会更新

[英]Ms access database is updated when the subform on Mainform is updated via vba

I have very strange problem I am working with MS access 2013 a application called "failure Analysis system" through which user can enter a different data for different system. 我有一个非常奇怪的问题,我正在使用MS Access 2013一个名为“故障分析系统”的应用程序,通过该应用程序,用户可以为不同的系统输入不同的数据。

I have cread a main form to enter a data lets say " Tb_Mainform " and in this Mainform I have also one subform called " tb_subform ". 我已经读过一个要输入数据的主表单,可以说“ Tb_Mainform ”,在这个Mainform中,我还有一个子表单,称为“ tb_subform ”。 whenever user change one combox in Mainform the subform is updated using 每当用户在Mainform中更改一个combox时,使用

Me.tb_suform.form.recordsoure = query

Me.tb_subform.requery

until now everything is gud subform is also updated. 到现在为止,所有的gud子窗体也都进行了更新。 when i click on subform to navigate, it updated the table with half unfilled data. 当我单击子窗体进行导航时,它用一半未填充的数据更新了表格。

How can i prevent this. 我怎样才能防止这种情况。 I am opening the main form by using 我正在通过使用打开主窗体

DoCmd.OpenForm "tb_Mainform", WindowMode:=acDialog, DataMode:=acFormAdd, OpenArgs:=C_ID

PS : Main form and subform using the same database table. PS :主表单和子表单使用相同的数据库表。

Below is the link with the same problem as mine. 以下是与我的问题相同的链接。 it is 6 year old post but i think after that something has to be change in Access until now. 这是6岁的帖子,但我认为之后直到现在,Access中的某些内容必须更改。

How do I prevent clicks on a subform causing updates on the main form 如何防止点击子表单导致主表单更新

I have created an unbound form. 我创建了一个未绑定的表格。 It contain subforom where I am saving the records manually in vba. 它包含子论坛,我将在VBA中手动保存记录。

comment by ChrisPadgham helped me a lot ChrisPadgham的评论对我有很大帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM