通过vba更新Mainform上的子表单时,MS Access数据库也会更新 [英] Ms access database is updated when the subform on Mainform is updated via vba

查看:75
本文介绍了通过vba更新Mainform上的子表单时,MS Access数据库也会更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到一个非常奇怪的问题,我正在使用MS Access 2013一个名为故障分析系统"的应用程序,通过该应用程序,用户可以为不同的系统输入不同的数据.

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.

我有一个输入数据的主窗体,假设说"Tb_Mainform",在这个主窗体中,我还有一个称为"tb_subform"的子窗体.每当用户在Mainform中更改一个combox时,都会使用

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". whenever user change one combox in Mainform the subform is updated using

Me.tb_suform.form.recordsoure = query

Me.tb_subform.requery

直到现在,一切都是gud子窗体也被更新.当我单击子窗体进行导航时,它用一半未填充的数据更新了表格.

until now everything is gud subform is also updated. 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 :使用同一数据库表的主表单和子表单.

PS: Main form and subform using the same database table.

以下是与我的问题相同的链接.这是6岁的帖子,但是我认为之后直到现在,Access中的某些内容还是必须更改.

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.

如何如何防止点击子表单而导致主表单上的更新

推荐答案

我创建了一个未绑定的表单.它包含子论坛,我将在VBA中手动保存记录.

I have created an unbound form. It contain subforom where I am saving the records manually in vba.

通过 ChrisPadgham对我有很大帮助

这篇关于通过vba更新Mainform上的子表单时,MS Access数据库也会更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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