[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

start up code that runs in MS Access

Posted on 2011-09-27
5
Medium Priority
?
364 Views
Last Modified: 2012-05-12
I would like to have code run on the start up of a database but do not want the user to be able to disable the action by holding down SHIFT.  I know I can disable the SHIFT key but still would like to know if it is possible if there is a place code can run without the SHIFT ket impacting it.  ~ Thanks
0
Comment
Question by:marku24
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 75
ID: 36710741
IF you Disable the Shift Key Bypass, then no startup will occur, because an AutoExec macro will not execute nor will any Form be  loaded.

And regarding Shift Key ... see this ... it's very cool:

The link below contains an MDB which allows you to 'set' and 'reset' the Shift Key Bypass from a REMOTE mdb.  
It's very cool. Scroll down the page to 'By Pass Shift Key Code'
And it works in A2010 also.
http://www.kallal.ca/msaccess/msaccess.html

mx
0
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 336 total points
ID: 36710817
<<IF you Disable the Shift Key Bypass, then no startup will occur, because an AutoExec macro will not execute nor will any Form be  loaded.>>

  Think mx meant to say this a bit differently; with the shift key bypass disabled, a user cannot stop the autoexec or startup form from running.

  If the shift key bypass is enabled, then a user can stop the autoexec or startup form from running by holding down the shift key.

  But note that if you have a savey user, they can use the code that mx pointed to and re-enable the bypass and bypass your startup.

Jim.
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 332 total points
ID: 36710860
Yeah ... no coffee yet ... bad idea to post under that condition!  

At the end of the day (after a lot of coffee), there is no fool proof way to keep a user from doing things. You can create an MDE (ACCDE) to protect your code, put on a database password and mess with the Shift Key ... but nothing is fool proof.

mx
0
 
LVL 26

Assisted Solution

by:Nick67
Nick67 earned 332 total points
ID: 36711005
<nothing is fool proof>
That is true enough.  In the end, you can make things incredibly inconvenient for someone.
Hide the Dtabase Wndow/ Nav Pain
Open a hidden form with your autoexec.
In the OnOpen() event of every object, check if that hidden form is open, if not Application.Quit
Make the file into an ACCDE, rename it to an ACCDR.
In the OnOpen() event of every object, check if the application is in runtime mode, if not Application.Quit.

That doesn't prevent anyone from creating a new db, and either linking or importing tables from the locked down one.
But it makes life tough.
And you have to be very careful that you don't lock yourself out!
0
 

Author Closing Comment

by:marku24
ID: 36711122
Isn't the answer I was looking for but it is what it is. ~ Thanks everyone
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

649 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