从表单中将记录保存到表的最佳实践 [英] Best practices for saving records to table from forms

查看:88
本文介绍了从表单中将记录保存到表的最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好, 


我想知道Access专家使用哪种方法将表单中输入的数据保存到表格中。


我正在构建的Access数据库几乎使用默认设置。我不是百分百肯定,但我相信当窗口关闭,用户移动到下一条记录时,或当焦点放在子窗体上时,Access会保存到表格中。


<我希望一切都尽可能方便用户使用。对我来说,有一个清晰的"保存"按钮可以让用户更清楚地保存数据。另一方面,我不想在尝试绕过
访问'默认行为时给自己带来不必要的麻烦。


在网上搜索时,我偶然发现了许多表格的截图使用保存按钮,显然这似乎是常见的做法。


如何处理将数据保存到数据库的表?



谢谢。





解决方案


你是对的。当其中一个事件发生时,绑定表单会自动将数据保存到表中。当开发人员想要控制何时必须将记录保存到表中时,他们可能会选择使用未绑定的表单。但是,如果您使用未绑定的表单,那么您(
作为开发人员)将必须处理Access在使用绑定表单时为您执行的所有自动操作。对于某些人来说,这比不必要的工作更多。对于其他人,根据他们的需要,这是必要的。


我可能会在我的表单上放置一个"保存"按钮,但它只是关闭表单,因为如你所说,关闭表单也会将数据保存到表格中。


只需2美分......


Hello, 

I'd like to know what approach you Access experts use regarding saving data entered in forms to tables.

The Access database I am building is pretty much using the defaults settings. I am not 100% sure, but I believe Access saves to the tables either when the Form is closed, when the user moves to the next record, or when the focus is placed on a subform.

I want everything to be as user-friendly as possible. To me, having a clear 'Save' button would make it more clear to the user that the data is being saved. On the other hand I don't want to give myself an unnecessary headache while attempting to bypass Access' default behaviour.

While searching online, I stumbled on many screenshots of forms with Save buttons, so clearly this seems to be common practice.

How do you handle saving the data to tables for your databases?

Thanks.


解决方案

Hi,

You are correct. Bound forms automatically save the data to the table when one of those events happen. When developers want to control when the record must be saved to the table, they may opt to use an unbound form. However, if you use an unbound form, you, as the developer, will have to handle all the automatic things Access does for you when using bound forms. For some people, it's more work than necessary. For others, based on their needs, it's a necessity.

I might place a Save button on my forms but it simply closes the form, because closing the form, as you said, will also save the data to the table.

Just my 2 cents...


这篇关于从表单中将记录保存到表的最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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