如何更改表单以允许控制保存记录更改? [英] How to change form to allow control of saving record changes?

查看:51
本文介绍了如何更改表单以允许控制保存记录更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我继承了一个具有设计形式的访问数据库,因此当用户在任何列(文本框)中进行更改时,表单左侧会出现一个条形并出现一支铅笔。如果用户未单击此铅笔,则不会保存更改,也不会显示警告消息。我们发现由于用户没有点击铅笔而导致很多变化。我被要求更改表单以在表单上放置保存记录按钮。我还需要检测他们是否对表单进行了更改,并且一旦进行更改就将此新按钮设置为启用。除非做出改变,否则他们希望它保持灰色。如果用户单击右上角的x按钮关闭表单或现有按钮将其带回主菜单,我想检查点是否有任何数据已更改并显示消息框提示他们是否要保存更改。


我已完成以下操作,更改了记录选择器和导航按钮表单上的属性''不''。

我尝试使用''关闭''的表格事件并进行测试

I have inherited an access database that has the forms designed so when a user makes a change in any column(text box), there is a bar on the left of the form and a pencil appears. If the user does not click on this pencil, the changes are not saved and there are no warning messages. We have found that lots of changes have been lost due to user''s not clicking on the pencil. I have been asked to change the forms to put a ''Save record'' button on the form. I also need to detect if they have made a change on the form and as soon as a change is made to set this new button to ''enabled''. They would like it to stay grayed out unless a change is made. If the user clicks on the ''x'' button in the upper right corner to close the form or a existing button to take them back to the main menu, I want to check at the point if any data has been changed and display a message box prompting them if they want to save the changes.

I have done the following, changed the properties on the form for ''Record Selector'' and ''Navigation Buttons'' to ''No''.
I tried using the form event of ''Close'' and put a test in for

展开 | 选择 | Wrap | Line Numb ers

推荐答案

你的方法听起来不错。表格上目前还有哪些其他代码?特别是寻找FORMs BeforeUpdate事件,以及表格Dirty event。
Your approach seems sound enough. What other code is currently on the form? Especially look for the FORMs BeforeUpdate event, as well as the forms Dirty event.


没有什么工作正常。我不熟悉左侧有一个条形的表格,当它做出改变时会出现一支铅笔。我需要弄清楚这是如何完成的以及如何摆脱它以便我可以控制保存。我想知道是不是因为表格列是''绑定''?
Nothing is working correctly. I am not familiar with the form having a bar on the left side with a pencil showing up when a change it made. I need to figure out how this is done and how to get rid of it so I can control the save. I wonder if it is because the forms columns are ''bound''?


可能是因为它们没有绑定。很多新手似乎都希望在不使用Access提供的方式(绑定表单等)的情况下处理表单上的数据保存。在这种情况下,发布表单的模块代码可能会有所帮助。我们可能会有一些线索。你还可以包括表格和记录控件是否真的全部绑定。


PS。使用CODE标签应该比在标签中输入更容易。在帖子窗口中有一个哈希(#)类型按钮,可以为任何选定的文本执行此操作。
It may be because they''re unbound. So many newbies seem to want to handle data saving on forms without using the way Access provides (Bound forms etc). Maybe posting the form''s module code would be helpful in this case. There may be some clues in there for us. Can you also include whether the form and the record controls are actually all bound.

PS. Using the CODE tags should be easier than typing in the tags. There is a hash (#) type button in the post window that will do it for you for any selected text.


这篇关于如何更改表单以允许控制保存记录更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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