Question

Prevent Users from Opening the Database window

Asked by: Pohara

To bypass the Startup option settings, hold down the Bypass (SHIFT) key while opening the database. This action will bypass any command entered in the startup window of Access.  One of the commands in this menu is the Display Database Window Check box.  If this box unchecked then the database will open with the form defined in the "Display Form" entry.  In addition if you Uncheck the "special Keys" check box the user cannot use the "F11" key to call up the window.  HOWEVER.....

If when you open the database from a the ACCESS command in the start bar if you press "SHIFT" at the same time then the "Start Up" box functions are completely ignored and the database window can be viewed.

How do prevent this?  Please note I already know the suggestion that can replace the "File" menu with a custom menu HOWEVER this does not work when a user who has his own version of access opens a copy of your file.

Any Ideas?

Thanks  Phil

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2001-09-28 at 15:12:13ID20188167
Tags

prevent

Topic

Microsoft Access Database

Participating Experts
5
Points
50
Comments
11

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Disable Shift F11
    Does anybody have a quick and easy way to disable Shift F11 for the users but still allow me in?
  2. Possible to disable F11?
    I have created a form with buttons & macros to allow users to run specific existing queries, display the tables produced, and run reports. I have used the Startup options to disallow full menus to be displayed, and to prevent display of the database. However, if the use...
  3. How can i disable shift and F11 in access2000?
    Hi ; Has anyone can help me about this?I can't disable shift key beginning of the program./regards
  4. MAKING THE F11 KEY NONWORKABLE
    I WANT TO MAKE IT SO MY USERS CANNOT SEE THE DATABASE WINDOW SO FAR I HIDE IT BY USING THE STARTUP MENU TO HIDE IT BUT THEY CAN ALWAYS USE THE F11 KEY TO GET TO IT HOW CAN I PREVENT THAT

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: dilligaffuqPosted on 2001-09-28 at 15:33:36ID: 6512643

I don't think it can be prevented.  Reason being that there would be no way to make changes to the database.

dill


 

by: nico5038Posted on 2001-09-28 at 15:46:24ID: 6512666

Phil,

100% won't be possible...

You can add the AllowBypassKey (check in the helpfile) setting to prevent the SHIFT from interrupting your startup, but for tables and queries no real "protection" is possible. All forms, Reports and Modules can be "protected" by the creation of an .mde, making them impossible to edit.

(BTW make sure to have an editable backup before setting AllowBypassKey or creating a .mde, as you can't open it either....)

Nic;o)

 

by: PoharaPosted on 2001-09-28 at 16:02:26ID: 6512689

Gentlemen:

Thanks very much for your comments so far.  The one thing I am not very clear on Nico is exactly how I set that property.  It appears the only way I can do this is to create a VB program to call up the Access file and change the property.  Therefore when another copy of ACCESS opens the file it will already be set. Am I understanding that correctly?

  So to clarify....  If I set it with a VB program and attach the property to the file when a computer that has it's own copy of Access on it calls it will it be set?

Thanks
phil

 

by: nico5038Posted on 2001-09-28 at 16:13:23ID: 6512707

You have differents options (as always...)
You could issue the command in the Immediate Window (Also known as the "debug window").
I myself added the code to switch this on AND off behind the OnClick event of two textboxes of the mainform....
(It's hard to impossible for a user to find this ;-)

Just check the code of the "AllowBypassKey Property Example" in the helpfile.

Nic;o)

 

by: mlmccPosted on 2001-09-28 at 16:54:51ID: 6512777

We do something that intercepts the shift key and only allows you in if you are in the admin group.  We of course have our own MDW file which only we can modify.  I'll supply the code when I get to work next week.

mlmcc

 

by: dovholukPosted on 2001-09-28 at 19:32:40ID: 6512892

i'll second what nico has written above. you will NEVER be guaranteed that your tables are inaccessible. as nico also mentions, queries will also be available and i'm pretty sure so will macros. that's not a lot of protection, but it does keep out all but the most advanced users (and even some developers! lol)

as for queries, a long time ago i stopped saving the queries as objects. i exclusively run the queries from code now. this prevents issues with queries. i try not to use macros, but you NEED to for autokeys. as for tables, you could actually do away with localized tables entirely and rely on the IN statement (see help) however this can be OVERLY complex and it's not as efficient as linked tables.

basically all you can hope for is that the users who DO have the knowlege to circumvent access security, don't exploit that knowlege...

good luck

dovholuk

 

by: nico5038Posted on 2001-09-29 at 00:02:07ID: 6513106

Hi dovholuk,

Missed my "Points for dovholuk" question ?

Nic;o)

 

by: nmilminePosted on 2001-09-30 at 00:01:46ID: 6514328

Hi Pohara

Here are 2 peices of code I use.

One turns on and off the startup options the other turns on and off the hiding of tables

Code One


'This sets security, so users can't fool around with stuff--very useful....

Sub SetStartupProperties()

ChangeProperty "StartupShowDBWindow", dbBoolean, False
'ChangeProperty "StartupShowStatusBar", dbBoolean, False
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowFullMenus", dbBoolean, False
ChangeProperty "AllowShortcutMenus", dbBoolean, False

ChangeProperty "AllowBreakIntoCode", dbBoolean, False
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False


End Sub

'This turns all the protection off

Sub SetAdminProperties()

ChangeProperty "StartupShowDBWindow", dbBoolean, True
'ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, True
ChangeProperty "AllowFullMenus", dbBoolean, True
ChangeProperty "AllowShortcutMenus", dbBoolean, True

ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, True
ChangeProperty "AllowBypassKey", dbBoolean, True


End Sub

'This part is the function used to make the changes

Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
Dim dbs As Database, prp As Property
Const conPropNotFoundError = 3270

Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True

Change_Bye:
Exit Function

Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function

Code Two


Public Sub HideTables()
   
   Dim tdf As TableDef
   
   For Each tdf In CurrentDb.TableDefs
       If tdf.Name Like "msys*" Then
       Else
           tdf.Attributes = dbSystemObject
       End If
   Next tdf
   
   Set tdf = Nothing
   
End Sub

Public Sub ShowTables()
   
   Dim tdf As TableDef
   
   For Each tdf In CurrentDb.TableDefs
       If tdf.Name Like "msys*" Then
       Else
           tdf.Attributes = 0
       End If
   Next tdf
   
   Set tdf = Nothing
   
End Sub

HTH
Neil

 

by: PoharaPosted on 2001-09-30 at 22:24:58ID: 6515601

Thank You EVERYONE who answered this question. From the comments above it is easy to see that this so called "simple" question was not so simple. I really appreaciate the excellent response.  I only wish I could award points to each of you.

I will try Niels code and see what happens. Since I am using Neils solution I will award him the points.  I must say I like this service.  

Thanks again

Phil

 

by: PoharaPosted on 2001-09-30 at 22:32:42ID: 6515605

I would love to see the code on the intercept of the shift key.  If mlmcc would like to post it I will certainly try to use.  

Thanks again to everyone who posted answers!

Phil

 

by: mlmccPosted on 2001-10-01 at 07:49:30ID: 6516811

This code is in a module called from the autoexec macro.

'Set Startup Properties to allow total access to database.
If CurrentUser() = "Admin" Then
    MsgBox "Admin is not a valid Login."
    DoCmd.Quit acExit
ElseIf CurrentUser() = "YOURLOGIN" Or CurrentUser() = "DATABASEADMINLOGIN" Then
    SetStartupProperties
End If


Sub SetStartupProperties()

Rem ******************************************************************
Rem * This procedure passes the name of the startup property to be   *
Rem * set, its datatype, and its desired setting.  It works with the *
Rem * ChangeProperty Function.                                       *
Rem ******************************************************************

ChangeProperty "StartupShowDBWindow", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, True
ChangeProperty "AllowFullMenus", dbBoolean, True
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, True
ChangeProperty "AllowBypassKey", dbBoolean, True

End Sub


Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
   
Rem *******************************************************************
Rem * This procedure attempts to set the startup property stated in   *
Rem * SetStartupProperties Sub Function. If the property is not found,*
Rem * it uses the CreateProperty method to append it to the database  *
Rem * properties collection.  This is necessary because these         *
Rem * properties do not appear in the properties collection until     *
Rem * they have been set or changed at least once.                    *
Rem *******************************************************************
   
Dim dbs As DATABASE, prp As Property
   
Const conPropNotFoundError = 3270
Set dbs = CurrentDb
   
On Error GoTo Change_Err

dbs.Properties(strPropName) = varPropValue
    ChangeProperty = True

Change_Bye:
    Exit Function

Change_Err:
    If Err = conPropNotFoundError Then  'prop not found
        Set prp = dbs.CreateProperty(strPropName, _
        varPropType, varPropValue)
        dbs.Properties.Append prp
        Resume Next
    Else
        'unkown error
        ChangeProperty = False
        Resume Change_Bye
    End If
End Function

Function DisableShiftKeyBypass() As Boolean

Rem ****************************************************************
Rem * Run this procedure from Debug.  After this procedure is run, *
Rem * the next time the datbase is opened the Autoexec marcro will *
Rem * NOT be bypassed, even if the shift key is pressed.           *
Rem ****************************************************************

Dim db As DATABASE
Dim prop As Property
Dim strmsg As String
Const conPropNotFound = 3270

On Error GoTo errDisableShift

Set db = CurrentDb()

db.Properties("AllowByPassKey") = False
DisableShiftKeyBypass = True

exitDisableShift:
    Exit Function

errDisableShift:
    'The AllowByPassKey property is a user-defined
    'property of the database that must be created
    'before it can bee set.  This error code will execute
    'the first time ths function is run in a database.
   
    If Err = conPropNotFound Then
        Set prop = db.CreateProperty("AllowByPassKey", _
            dbBoolean, False)
        db.Properties.Append prop
        Resume Next
    Else
        strmsg = "Function DisableShiftKeyBypass did not "
        strmsg = strmsg & "complete successfully."
       
        MsgBox strmsg, vbExclamation
        DisableShiftKeyBypass = False
        GoTo exitDisableShift
    End If
End Function

Sub SetStartupProperties_Close()

Rem ******************************************************************
Rem * This procedure passes the name of the startup property to be   *
Rem * set, its datatype, and its desired setting.  It works with the *
Rem * ChangeProperty Function.                                       *
Rem ******************************************************************

ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowFullMenus", dbBoolean, False
ChangeProperty "AllowBreakIntoCode", dbBoolean, False
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False

End Sub

This code is run to lock the database.  Only the developer or database administrator login can execute it.

Public Function CloseDBbyDeveloper()

Rem ************************************************************
Rem * Allows the Developer or DB Administrator to select the   *
Rem * type of Startup Properties to close the Database with.   *
Rem * This procedure must be RUN each time the Developer or    *
Rem * Administrator Logs out of CTS.  If not, the Database     *
Rem * will left unsecured.                                     *
Rem *                                                          *
Rem * If logged out with User Properties, the Database will be *
Rem * reverted back to User properties the next time a user    *
Rem * logs into CTS.                                           *
Rem ************************************************************

Dim strLogoffMsg As String
Dim Style As String
Dim Title As String
Dim Response As String

If CurrentUser() = "YOURLOGIN" Or CurrentUser() = "DATABASEADMINLOGIN" Then
    strLogoffMsg = "Do you want to change Startup Properties back to "
    strLogoffMsg = strLogoffMsg & "User Properties and Close the Database?"
    strLogoffMsg = strLogoffMsg & Chr$(13) & Chr$(13)
    strLogoffMsg = strLogoffMsg & "YES *** Change Properties & Exit CTS"
    strLogoffMsg = strLogoffMsg & Chr$(13) & " NO *** Exit CTS"
   
    Style = vbYesNo + vbQuestion + vbDefaultButton1
    Title = "Administrator/Developer Closure Options"
    Response = MsgBox(strLogoffMsg, Style, Title)
       
    If Response = vbYes Then
        SetStartupProperties_Close
        ExitCTS
    Else
        ExitCTS
    End If
Else
    Exit Function
End If

End Function

delete the admin login or give it no priveleges.

We control access to the tables, queries, modules, forms, and reports through groups.  Only members of the development staff have modify permission.  All queries are run with owner's permissions and the owner is a member of the development staff.

Access through the program is controlled by user priveleges stored in a table and set when the user logs in.

Hope this helps
mlmcc


20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...