Solved

Enable shift override after converting from Access 2003 to Access 2007

Posted on 2010-09-02
12
430 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:wlreimer
Comment Utility
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
Comment Utility
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
Comment Utility
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
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 

Author Comment

by:wlreimer
Comment Utility
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
Comment Utility
Then would disabling the Autoexec macro, then converting the database have helped?
0
 

Author Comment

by:wlreimer
Comment Utility
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
Comment Utility
Click on the yest, next to the solution that you found helpful.
0
 

Author Closing Comment

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

Author Comment

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

Featured Post

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.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

744 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

18 Experts available now in Live!

Get 1:1 Help Now