且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何防止Access关闭

更新时间:2023-12-02 09:46:40

将逻辑放在'卸载事件的形式中,以检查表格是否已经

已完成或未完成。如果没有,请设置取消=真,并且表单不会被b / b
关闭,从而使应用程序无法关闭。


-

Doug Steele,Microsoft Access MVP
http:/ /I.Am/DougSteele

(请不要发电子邮件!)


< al ******** @ hotmail.com&GT;在消息中写道

news:11 ********************** @ g43g2000cwa.googlegr oups.com ...
Put logic in the form''s Unload event to check whether the form has been
completed or not. If it hasn''t, set Cancel = True, and the form won''t be
able to close, thereby keeping the application from closing.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

<al********@hotmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
我有一个用户必须在关闭之前完成的表单。我已经禁用了窗口x按钮并使用我自己的退出按钮。选中后,它会检查用户是否已完成输入,否则会取消关闭。
但是,用户仍然可以右键单击任务栏并关闭我的
申请。
有没有办法防止这种情况。
谢谢
Alex
I have a form which the user must complete before closing. I have
disabled the window x button and use my own exit button. When selected
it checks to see if the user has completed the entries otherwise it
cancels the close.
However, the user can still right click on the task bar and close my
application.
Is there any way of preventing this.
Thanks
Alex



这不会阻止用户右键单击任务栏按钮

然后选择关闭它。

Alec

This does not stop the user from right clicking on the taskbar button
and selecting close to close it.
Alec


否,没有(可靠的)方法来防止这种情况发生。当所有其他方法都失败时,

用户*将*从机器上拔下电源线。


要求用户以前做的事情是个坏主意他们可以关闭您的表格或申请表。相反,为您的用户提供一种方式

来退出他们正在做什么,和/或某种方式回到他们不得不停下来的时候。

No, there''s no (reliable) way to prevent this. When all else fails,
users *will* yank the power cord from the machine.

It is a _really_ bad idea to require users to do things before they can
close your form or application. Instead, provide your users with a way
to "back out" of what they were doing, and/or a way to get back where
they were when they had to stop.