问题描述
下午所有,
欢呼任何可以提供帮助的人!到目前为止,这个论坛对我来说是一条很大的生命线!!
我相信这是我的数据库完成之前的最后一道障碍!
问题 - 我有一个包含3个子表单的主表单。每个子窗体都是隐藏的,直到通过使用复选框使其可见(代码已被写入,只允许一个盒子在任何时候都可见)。这些一直工作得很好但突然间我开始收到错误信息
数据已被更改。另一位用户在您尝试保存更改之前编辑了此记录并保存了更改。
这是很难相信的,因为我是唯一一个使用数据库的人。我找到了一些与此有关的文章,但没有人建议可能解决这个问题。
微软网站说要修复问题以添加Me.Parent。重新查询"到子表单上的AfterUpdate事件。这确实有效但现在当您尝试使用复选框更改子表单时,第一次单击复选框会出现触发AfterUpdate,但您必须重新单击相同的复选框才能实际更改表单。
即要从汽车更改为旅行子窗格,您必须单击旅行复选框,等待一两秒钟,然后再次单击旅行复选框以实际更改它。
似乎有点迂腐我知道,但它只是使表格非用户友好。
开放给建议!!干杯。
Afternoon all,
Cheers to anyone who can help! So far this forum has been a big lifeline to me!!
I believe this to be the last hurdle before my database is complete!
Problem - I have a main form with 3 subforms. Each subform is hidden until it is made visible through use of a check box (code has been written to only allow one box to be visible at any one time). These had been working perfectly but all of a sudden I have begun to get the error message
"The data has been changed. Another user edited this record and saved the changes before you attempted to save your changes"
This is hard to believe as i am the only person using the database. I have found a few articles relating to this but no-one ever suggests a possible fix for this problem.
The Microsoft site says to fix the problem to add "Me.Parent.Requery" to the AfterUpdate event on the subforms. This does work but now when you try to change subforms using the check boxes, the 1st click on a check box appears to trigger the AfterUpdate but then you have to re-click the same check box to acctually change forms.
i.e. to change to Travel Subform from Cars you have to click the Travel Check Box, wait a second or two, and then click the Travel Check Box again to actually get it to change.
Seems a little pedantic i know but it just makes the form non user friendly.
Open to suggestions!! Cheers.
推荐答案
更改默认记录锁定设置为编辑记录并注释掉Me.Parent.Requery代码。这是否解决了这个问题?
Mary
Change Default Record Locking set to "Edited Record" and comment out the Me.Parent.Requery code. Does this solve the problem?
Mary
这篇关于错误 - 数据已更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!