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

流过昼夜 提交于 2019-12-02 14:18:25

问题


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.

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

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: Main form and subform using the same database table.

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.

How do I prevent clicks on a subform causing updates on the main form


回答1:


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

comment by ChrisPadgham helped me a lot



来源:https://stackoverflow.com/questions/49064930/ms-access-database-is-updated-when-the-subform-on-mainform-is-updated-via-vba

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!