切换到设计视图时取消OnClose事件 [英] Cancel OnClose event when switching to design view

查看:101
本文介绍了切换到设计视图时取消OnClose事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个OnClose函数可以打开一个交换机(SwitchOpen)。此函数放置在众多对象''(报表和表单)OnClose事件中,效果很好。然而,发生了非常烦人的事情:当我打开一个对象时,然后单击设计视图,OnClose事件触发,导致交换机打开事件,尽管该对象并未真正关闭。我应该在什么事件下放置SwitchOpen,以便它只在对象真正关闭时触发而不仅仅在设计视图中触发?

I have an OnClose function that opens a switchboard (SwitchOpen). This function is placed in numerous objects'' (reports and forms) OnClose event, and works great. However, a very annoying occurrence happens: when I have an object open, then click Design View, the OnClose event triggers, causing the switchboard to open event though the object isn''t truly "closed". What event should I place the SwitchOpen under so that it only fires when the object is truly closed and not just in design view?

推荐答案

事实上,你< b> 切换到设计视图时关闭表单。当发生这种情况时,Access也会认为表单是 UnLoading ,所以在这里移动它也不会有任何帮助。我不确定你能做什么,除了在开发表格时注意打开配电盘的线路,然后在准备投入生产时取消注释。这种情况经常发生在这样的情况下。


Linq ; 0)>
In point of fact, you are closing the form when you switch to Design View. Access also considers the form to be UnLoading when this happens, so moving it here won''t help either. I''m not sure you can do anything except remark out the line opening the switchboard when you''re developing the form, then un-remark it when you''re ready to go into production. This is frequently done for situations just like this.

Linq ;0)>


我同意Linq我很害怕当您切换到设计视图时,该对象将关闭。


但是,您可能希望使用以下过程调用来查看是否可以确定该项目是否在否则你的代码会启动交换机。
I agree with Linq here I''m afraid. The object is closed when you switch to design view.

However, you may want to play with the following procedure call to see if you can determine whether or not the item is open at the time your code would otherwise start the switchboard.
展开 | 选择 | Wrap | 行号


你需要使用我怀疑的On Error代码,可能会在通话结束后立即检查Err对象。


如果有帮助,请告知我们以及如何继续使用。
You''ll need to use On Error code I suspect, and probably inspect the Err object immediately after the call.

Let us know if this helps and how you get on with it.


这篇关于切换到设计视图时取消OnClose事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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