Default Menu bar

J

JimP

I have some code that runs when an mdb opens with a custom menu bar.
However, the MS-Access default menu bar is visible until the code is
finished running at which point it disappears.

Is there a way to hide the MS-Access default menu bar while the startup code
executes?

My attempts to keep it from showing have been unsuccessful thus far.
 
A

Albert D. Kallal

You might be able to set the main menu .visible = false
(and then execute a doEvents).

Another way is to use a shortcut with the /runtime switch......

(it will show the default runtime menu..but, it is a limited one, and no
toolbars will show).

I not tried the 1st suggestion, but, the 2nd suggestion I use a lot to hide
things during startup...
 
A

Albert D. Kallal

Thanks - how do I refer to a menu in order to examine its properies
collection?

CommandBars("menu bar")

Menu bar is the "main" built in bar....

So, you could try
CommandBars("menu bar").visible = false

But, I NEVER did write any Actual code to hide the menu bars of my
applications anyway. If you specify your own menu bar in the tools ->
startup settings, then you actually don't need any code to hide the built
and menu bars anyway. This approach takes zero code, and likely runs
faster/sooner than if you try and wait for the whole application to load,
then load the VBA libraries, and THEN start to run your code.

For menu bar manipulation you can do stuff like:

if IsInGroup(CurrentUser(),"InvoideDeleteGroup") = true then

CommandBars("myCustomBar").
Controls("AdminOptions").
Controls("DleeteInvoice").Visible = True

end if

Note that short cut menus are their own name also:

commandbars("your shortcut name").Contorls("contorlName").visiable = false

As I mentioned, I not tried the 1st approach, and until the form + your code
*STARTS* to run, you likely still see the menu bar for a period of time
(thus, I suggest you use the 2nd approach (/runtime switch to hide
everything. It also has the added benefit of NOT showing the access icon in
the upper left corner, and will show ONLY your custom icon specified. So, I
like the runtime idea the best..).

Try downloading and running the 3rd example at my following web site that
shows a hidden ms-access interface, and NO CODE is required to do
this....but just some settings in the start-up.

Check out:

http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm

After you try the application, you can exit, and then re-load the
application, but hold down the shift key to by-pass the start-up options. If
want, you can even disable the shift key by pass. I have a sample mdb file
that will let you "set" the shift key bypass on any application you want.

You can get this at:

http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top