如何关闭(卸载)表格 [英] How to close (unload) a form
本文介绍了如何关闭(卸载)表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含一些按钮的表单,当用户单击一个按钮时,该表单应关闭(卸载).我使用了以下方法,但是所有方法都会产生错误:
I have a form that has some buttons, and when user click on a button, the form should be closed (unloaded). I used the following methods, but all generate error:
docmd.close me
unload me
在VBA中(从表单内的代码)关闭或卸载表单的最佳方法是什么
What is the best way to close or unload a form in VBA (from code inside the form)
推荐答案
DoCmd.Close
期望 ObjectType 作为其第一个参数,后跟 ObjectName ,这是一个变体字符串,如下所示:对象名称.
DoCmd.Close
expects ObjectType as its first argument, followed by ObjectName which is a variant string as the object name.
因此,在旨在关闭当前表单的命令按钮的click事件中,我使用了此命令...
So in the click event of a command button which is intended to close the current form, I use this ...
DoCmd.Close acForm, Me.Name
这篇关于如何关闭(卸载)表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文