tags:

views:

52

answers:

3

I want to write some VBA script so that when I start my access application the main window is blank. This is the list of things I need to be removed or hidden:

  • The entire ribbon
  • The status bar
  • The navigation pane
  • The window tabs

In addition, I want to disable the popup menu when right clicking. I also want to disable SHIFT bypass key startup.

I basically want it to look like an application created with VB or C#. Only if I login as admin will the disabled options be bypassed.

+3  A: 

Does it need to be VBA? Why not using the normal Access Application Options?

In Access 2010 you can find them via File > Options > Current Database. Almost all the things you want can just be unchecked - see the following screenshot. The options you select there are saved with your database.

You can start the database while holding SHIFT which will override these start up options and show you your "normal" ribbon, status bar, navigation bar, ...

Access 2010 Application Options

moontear
A: 

Actually, as noted, you can use the startup options to remove most all of the questions you have in terms of popups, the tabs etc.

To hide ribbon, qat, just use:

DoCmd.ShowToolbar "Ribbon", acToolbarNo

So, with the options setup correct and ONE line of code, you only see your form.

Here is an resulting screen shot of using the above one line of code and options to turn off tabs (you want tabbed windows, but tabs turned off). Note how you see the windows desktop. this was all done with one line of code as per above:

alt text

Albert D. Kallal
Yes, but did you notice how the access window flickered and showed the toolbar at startup or not? I wanted this to look professional.
cmaduro
See m additional comments, I address the flicker issue
Albert D. Kallal