ACCESS/VBA:如何创建一个 ON/OFF 类型的开关以允许在表单上修改记录?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4602599/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ACCESS/VBA: How to create a ON/OFF type switch to allow record modification on a form?
提问by Christian M
I was using a combobox on my search form to select whether to consult or modify a record. To make it more user friendly (IMO), I put a togglebutton on a form, which controls the .AllowEdits property of my form. This way you can easily switch from reading to writing.
我在搜索表单上使用组合框来选择是查阅还是修改记录。为了使其更加用户友好 (IMO),我在表单上放置了一个切换按钮,该按钮控制我的表单的 .AllowEdits 属性。通过这种方式,您可以轻松地从阅读切换到写作。
However I run into a problem; once .AllowEdits is switched to false, the togglebutton is not clickable anymore !
但是我遇到了一个问题;一旦 .AllowEdits 切换为 false,切换按钮将不再可点击!
What are my options ?
我有哪些选择?
回答by Patrick Honorez
You must use a command button instead. It will not get locked.
You will however run into similar problems with other controls like a combo box you would use for quick searching a record. If you have that problem, use the solution hereto lock/unlock all your bound controls.
您必须改用命令按钮。它不会被锁定。
但是,使用其他控件(例如用于快速搜索记录的组合框)时,您会遇到类似的问题。如果您遇到该问题,请使用此处的解决方案来锁定/解锁所有绑定控件。