Solved

Enable shift override after converting from Access 2003 to Access 2007

Posted on 2010-09-02
12
459 Views
Last Modified: 2012-06-27
I have an Access 2003 application that I inherited, but I want to convert it to 2007.  It has a back end and front end.  When I convert the front end by using the Convert option in 2007, it opens .accdb right after conversion, but if I close it and try to re-open the project by holding the shift key while opening, I still get the opening form.  It won't bypass the code and open the project.

I don't really think that shift has been turned off because I never had this issue in 2003, only after converting to 2007.

Any help would be appreciated.
0
Comment
Question by:wlreimer
  • 6
  • 4
  • 2
12 Comments
 
LVL 10

Accepted Solution

by:
t_hungate earned 500 total points
ID: 33587315
Have you gone into the options>Current DB, and made sure that there is a check in the box next to Use Access Special Keys?

TLH
0
 
LVL 10

Assisted Solution

by:t_hungate
t_hungate earned 500 total points
ID: 33587389
This may also help you with your problem.  The shift key or bypass key can only be enabled and disabled via VBA.

http://msdn.microsoft.com/en-us/library/aa140020.aspx

TLH
0
 
LVL 10

Assisted Solution

by:t_hungate
t_hungate earned 500 total points
ID: 33587516
This code should take care of it if the other options that I provided do not pan out.

Courtesy of Access Freak.com  - http://www.access-freak.com

Public Function SetAllowBypassKeyTrue()

'----- Setup Error Handler
On Error GoTo Err_SetAllowBypassKeyTrue

'----- Dimension (Variable Declaration)
Dim db As DAO.Database, prp As DAO.Property

'----- Set AllowBypassKey property if it exists
Set db = CurrentDb

db.Properties("AllowBypassKey") = True

Set db = Nothing

'----- Exit Label
Exit_SetAllowBypassKeyTrue:

Exit Function

'----- Error Handler
Err_SetAllowBypassKeyTrue:

'----- Property not found error
'----- Create property if it does not yet exist
If Err = 3270 Then  

Set prp = db.CreateProperty("AllowBypassKey", dbBoolean, True)
db.Properties.Append prp

Resume Next

Else

'----- some unspecified error occurred
MsgBox "SetAllowBypassKeyTrue", Err.Number, Err.Description

Resume Exit_SetAllowBypassKeyTrue

End If

End Function


The above code needs to be executed only once within the application to set the property.  Keep in mind this method can also be used to turn the AllowBypassKey option to false as well.


TLH
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:wlreimer
ID: 33588424
Ok, I tried to do this in the immediate window but get a Compile error: Invalid in Immediate pane.  Where else would I run it from?
0
 

Author Comment

by:wlreimer
ID: 33588449
Interestingly enough, it appears that I am able to open the project until I create an accde.  Once I create the .accde I can no longer open the .accdb either, it goes right to the startup form.  Could there be something in 2007 that is programmatically turning off the Access Special Keys or disabling the shift override at the time a .accde is created?
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 33588604
Did you try t_hungate's first suggestion?
What was the result?

Did you try t_hungate's second suggestion?
What was the result?


First, run the compact repair utility in Access 2003 on the 2003 database, just to make sure everything is OK in the 2003 database, *before* you convert the DB.
If you try this, does it make any difference?

What is triggering the Opening form?
The Current Database Display Form setting, or an autoexec macro?

JeffCoachman
0
 

Author Comment

by:wlreimer
ID: 33589367
Did you try t_hungate's first suggestion?
What was the result?
Yes, (it was not checked initially), can open until I create an accde with it..

Did you try t_hungate's second suggestion?
What was the result?
Yes, same as above.


First, run the compact repair utility in Access 2003 on the 2003 database, just to make sure everything is OK in the 2003 database, *before* you convert the DB.
If you try this, does it make any difference? This was the first thing that I tried.

What is triggering the Opening form?
The Current Database Display Form setting, or an autoexec macro?
AUTOEXEC Macro

AFTER A LITTE MORE TESTING: IT'S NOT CREATING THE ACCDE THAT'S CAUSING THE PROBLEM.  IT'S ALLOWING THE ACCDB TO LAUNCH WITHOUT THE SHIFT KEY THAT'S CAUSING IT.  IF I HOLD DOWN SHIFT AS I CREATE THE .ACCDE THE PROJECT REMAINS OPEN AND I CAN REOPEN AFTER.  IF I DOUBLE CLICK THE ACCDB EVEN ONCE, IT'S LOCKED UP.   ORIGINALLY I WASN'T HOLDING SHIFT WHEN CREATING THE ACCDE AND IT WOULD LAUNCH THE APP AS IT COMPLETED THUS LOCKING IT.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 33589733
Then would disabling the Autoexec macro, then converting the database have helped?
0
 

Author Comment

by:wlreimer
ID: 33589777
I found it.  There was a string of code in the specified form telling it to disable special keys.  Interesting that it didn't really do anything in 2003, but did in 2007.  Thanks for all of your help, I wouldn't have found it otherwise.  How do I give boag2000 credit?
0
 
LVL 10

Expert Comment

by:t_hungate
ID: 33589851
Click on the yest, next to the solution that you found helpful.
0
 

Author Closing Comment

by:wlreimer
ID: 33590018
Thanks for everything, you guys always save me a ton of time.
0
 

Author Comment

by:wlreimer
ID: 33590025
Sorry, I really meant t hungate.  It was your help that did it.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
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…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

860 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