Solved

Removing the menu toolbar from an MSAccess database

Posted on 2014-03-11
6
326 Views
Last Modified: 2014-03-25
Hi all,


This is perhaps an easy question but one that I am trying to implement.

I have several different databases running with simple password forms at the beginning. These as you can imagine can be bypassed. But I was wondering whether there is a way of removing the Access menu bar which allows the user to unhide the database and therefore get access to the different objects.

I know this is not perhaps the ideal solution for a password protected database but in my case it goes a long way.

Thanks
0
Comment
Question by:PipMic
  • 3
  • 3
6 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
Comment Utility
What version of Access are you using?
0
 

Author Comment

by:PipMic
Comment Utility
2003


:)
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
Comment Utility
Sorry,

Don't have a box running 2003 at the moment and cannot remember how to do it.  

But you might try:

Private Sub Form_Open(Cancel As Integer)
    Application.CommandBars("Menu Bar").Enabled = False
End Sub

Don't forget to re-enable that somewhere in your code.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:PipMic
Comment Utility
hi Dale,

the code works a treat but I've been reading around and some say that that kind of coding should not be used because it locks the entire programme down!!!
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 125 total points
Comment Utility
That is why I said to re-enable that commandbar when you close your application.

I hide the Office 2007/2010 ribbon with a similar technique in all my applications.

As long as you have good error handling, and have a way to restore the commandbar, you should not have a problem.

Worst case open the database with the Ctrl-Shift to bypass any startup form or autoexec.  Then hit Ctrl-G to open up the VB Editor and type:

Application.CommandBars("Menu Bar").Enabled = True

In the immediate window.
0
 

Author Closing Comment

by:PipMic
Comment Utility
Thanks..does the trick

Apologies for the delay
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now