?
Solved

start up code that runs in MS Access

Posted on 2011-09-27
5
Medium Priority
?
362 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

770 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