使用VBA设置启动显示形式
是否可以使用VBA更改启动显示形式?使用“访问选项”页面很容易做到这一点,但我试图从 VBA 中执行此操作,但似乎没有任何效果。我到处搜索寻找允许这样做的数据库属性或设置。
有人对这个问题有任何见解吗?
Is it possible to change the Startup Display Form using VBA? It is very easy to do using the Access Options page, but I am trying to do this from within VBA and nothing seems to work. I've searched all over looking for Database properties or settings that would allow for this.
Does anyone have any insight into this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以通过 将内置数据库属性
StartUpForm
设置为表单的名称。要从启动中删除此表单,您只需删除该属性即可。
You can set a form to automatically open up in access VBA by setting the built-in database property
StartUpForm
to the name of the form.To remove this form from startup you can simply delete that property.
我不知道如何直接更改启动表单属性,但您可以尝试创建一个可以加载所需启动表单的表单。通过这种方式,您可以将要加载的表单存储在配置表中并通过 VBA 更改它。
缺点是实际上启动了两种形式,而不是一种。
I don't know about directly changing the startup form property but what you could try is creating a form that can load your desired startup form. This way you can for instance store the form to be loaded in a config table and change it via VBA.
Downside is that effectively two forms are started and not one.
看一下 autoexec 宏。当您的数据库启动时,它会为您运行代码。使用它来加载表单。
Have a look at the autoexec macro. It'll run code for you when your database is launched. Use this to load a form.