是否可以使用VBA设置Access Startup Options? [英] Is It possible to set Access Startup Options using VBA?

查看:80
本文介绍了是否可以使用VBA设置Access Startup Options?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MS Access 2007.


我有一个数据库,我完成所有编辑和编程并具有某些访问选项(在当前数据库选项卡下)设置单向在编辑过程中。但是,当我将数据库编译到.accde文件中时,我重新打开数据库并设置某些选项,例如初始显示表单和导航窗格选项。我在编程期间保持这些功能,以便于使用,但是在编译时禁用它们以防止其他人使用它们(或者至少使其更难)。


是否可以使用VBA设置这些选项以在编译后自动执行此过程?我已经有代码重新映射我所有的链接表并修改/删除未使用的Switchboard项目。


有没有人有这方面的经验?谢谢!

解决方案

我认为你指的是数据库的StartUp属性,是的,它们可以被修改,但它有点棘手,因为它们是用户定义的属性,不能以传统方式设置/检索。如果属性存在,您可以直接修改它,如果不存在,则必须创建它,然后将其附加到正确的Collection。下面的代码将允许完整菜单启动数据库选项为假:

  1. 功能定义:

    展开 | 选择 | Wrap | 行号


感谢ADezii,


BRILLIANT!这对于关闭完整菜单非常有效。但是,在哪里可以找到这些其他属性的名称,例如允许默认快捷菜单等?我尝试了一些变化,似乎没有任何工作。


此外,如何使用VBA告诉数据库在打开时打开特定表单?手动操作很容易,但我不知道从哪里开始在VBA中这样做....


感谢您的帮助到目前为止!


< blockquote>你问题的所有答案如下:

展开 | 选择 | Wrap | 行号


I am using MS Access 2007.

I have a database that I do all my editing and programming in and have certain Access options (under the Current Database tab) set one way during the editing. However, when I compile the database into the .accde file, I reopen the database and set certain options, such as the initial display form and navigation pane options. I keep these enabled during programming for ease of use, but disable them whem compiled to prevent others from possibly using them (or at least making it more difficult).

Is it possible to use VBA to set these options to automate this process after the compile? I already have code re-mapping all my linked tables and modifying/deleting unused Switchboard items.

Does anyone have any experience with this?Thanks!

解决方案

I think you are referring to the StartUp Properties of a Database and yes, they can be modified but it is a little tricky since they are User Defined Properties and cannot be Set/Retrieved in the conventional manner. If the Property exists, you can directly modify it, if not you must create it then Append it to the proper Collection. The Code below will set the Allow Full Menus Start Up DB Option to False:

  1. Function Definition:

    Expand|Select|Wrap|Line Numbers


Thanks ADezii,

BRILLIANT! That worked perfectly for turning off full menus. However, where does one find the names of these other properties, such as Allow Default Shortcut Menus and the like? I''ve tried some variations and nothing seems to work.

Also, how does one use VBA to tell the Database to open a specific form when it opens? Doing it manually is easy, but I have no clue where to start doing this in VBA....

Thanks for your help so far!


All the answers to your questions are listed below:

Expand|Select|Wrap|Line Numbers


这篇关于是否可以使用VBA设置Access Startup Options?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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