关闭访问应用程序 [英] close access application

查看:105
本文介绍了关闭访问应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如果在应用程序中打开任何报告或表单,我可以阻止关闭数据库吗?

谢谢


can I prevent closing the database if any report or form is opened in the application?
thank you

推荐答案

您需要提供更多逻辑。为什么数据库关闭开始?


Pat
You would need to provide a little more logic. Why is the database closing to begin with?

Pat


@ zepphead80




感谢您的快速回复

如果打开任何表格或报告,我需要阻止从X按钮关闭整个应用程序,因为我的表单有退出按钮如果用户关闭了数据库,表单中的数据将被保存,如果表单以任何其他方式关闭,除了退出按钮

,例如,如果我打开表单并填充一些数据,我需要退出没有保存,如果我点击退出,数据将不会保存(特别是使用mainforms和子表格删除),但是如果我关闭整个应用程序就会出现大问题

第二个问题如果我突然中断怎么办?
@zepphead80

thanks for your quick reply
I need prevent close the whole application from ''X'' button if any form or report is opened because I have forms that have Exit buttons and if the user closed the database the data in the forms would be saved if the forms closed in any other way except the Exit button
for instance if I opened form and filled some data and I need to exit without save, if I click Exit the data will not be saved (deleted especially with mainforms and subforms)but if I closed the entire application that would big problem
the second problem what about if I have sudden outage


您需要在背景中保持隐藏的表单应用程序运行时的d。然后,如果有人试图关闭应用程序,那将形成卸载事件将触发。然后,如果设置标准不满意,您可以添加您想要触发的任何代码。


但是,您可以做的很少有关于突然中断的事情它会强制杀死文件而不是关闭。


我可以建议的一件事是,如果您唯一担心的是任何记录保存是通过适当的关闭过程完成的您可以将代码添加到每个表单的卸载事件以撤消任何更改。任何保存的更改不会受到影响。


类似......

You need to keep a hidden form running in the background of the application while it is running. Then if anyone tries to close out of the application that forms unload event will trigger. You can then add any code you want to that form to be triggered if set criteria aren''t satisfied.

However, there is not much you can do about a sudden outage in that it will force a kill of the file rather than a close out.

One thing I could suggest is that if your only concern is that any record save is done through the proper close process then you could add code to the unload event of each form to undo any changes. Any "saved" changes would not be affected.

Something like ...

展开 | 选择 | 换行 | 行号


这篇关于关闭访问应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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