• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 469
  • Last Modified:

Can't open MS Access db

I have a MSAccess database with a fair amount of VBA n it. It was originally created with version 1.1 in 1994, and upgraded and updated throughout the years. I recently installed Office 2013 and made all the necessary changes and adjustments (such as updating the references) so it runs flawlessly on my 2013 box. Problem is, I try to run it on another machine where it ran fine with office 2010, after upgrading to office 2013 it will not run. I have tried using admin rights and that is not the issue. I am attaching a file with screenshots I see when I open the db on machine number 2. After clicking "stop all macros" (my only option, MS Access closes).

OS on both machines is Win 7 Pro 64 bit
MSAccess-errors.docx
0
M_Epstein
Asked:
M_Epstein
  • 6
  • 4
  • 4
  • +4
12 Solutions
 
ste5anSenior DeveloperCommented:
Don't post images in containers. Simply add it directly to your message. Use the image button: EE Message Toolbar
0
 
M_EpsteinAuthor Commented:
error messages
Better now?
0
 
Jeffrey CoachmanCommented:
IMHO, ...you should dump the autoexec macro and use code on the open event of your main form.

A lot has changed in the Macro language since 1994.

Most of the time you can accomplish the same thing.

Can you explain what this macro is doing?
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I'd check references on the trouble machine. If you've run the database in 2013, then then pass it to someone with 2010, you very likely have a Reference issue. If you can list out the references you're using, we might be able to spot a potentially troubling one.
0
 
M_EpsteinAuthor Commented:
The db works on a 2013 machine. I passed it to another 2013 machine and it crashes. I then just tried to run it on a 2010 machine, (it always ran on 2010) and it runs fine.

I went into the design mode on my 2010 machine - so much has changed since I coded in version 1.1 thru 2003. I feel lost. How do I find the startup box - that tells me what code or macro is run at startup? Also, I went into the macro editor - I see the list of all the macros, including autoexec, but it does not show me the contents of each macro. Need some help here please. Thank you.
0
 
Jeffrey CoachmanCommented:
How do I find the startup box - that tells me what code or macro is run at startup?
Does not really exist in Access 2010, ...you can go here to set what form opens first:
File-->Options-->Current Database-->Display Form

But if the macro is named Autoexec it will always run first (even before any code on the startup form.)

Click "Macros" in the Navigation pane and then "Right Click" the Macro named autoexec and select "Design view"
Then take a screenshot and post it here,...

But also describe what this macro is doing...

JeffCoachman
0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
As Scott said, references maybe the main issue.  Also be aware that from 2010 on, there are two editions of Office 32 and 64 bit, either of which may run under a 64 bit OS.

Depending on the code you used (any Windows API's), you may find that it won't run under the 64 bit version of Office.

The start-up is specified as part of the current DB options.  That's on the backstage (File) menu, all the way at the bottom "Options", then on the current database tab.

Macro's need to be opened in design view to see what their doing.   Right click on the macro name and select design.

Jim.
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
The db works on a 2013 machine. I passed it to another 2013 machine and it crashes.
So check your references, which may be different between the two machines.

Also be sure that Windows and Office are fully updated on the trouble machine, and that you have a valid default printer installed (sounds odd, but Access has real troubles if printer troubles arise).

Finally, you might try logging in on the trouble machine as a different user. If THAT user can run the database, then the problem is with the User Profile on the machine. You'll have to remove and recreate that profile.
0
 
Gustav BrockCIOCommented:
You are running a menu command. Menus don't exist in the user interface in A2013.

The macro is probably trying to hide the database Windows which neither exist in A2013 (replaced by the navigation pane).

You can probably drop the menu call completely.

/gustav
0
 
M_EpsteinAuthor Commented:
Menu command, Gustav? For example?? Pardon me, but its been years since I coded this app and Im not only out of practice, but also never really learned the last three versions. Kind of stuck and limping along from Office 2003.
0
 
Jim P.Commented:
You can right click any macro and turn it into VBA code. That might make more sense.
0
 
Gustav BrockCIOCommented:
I just read from your picture:

DoMenuCommand 1, 4, 3, 0

So what happens if you just leave it out?

/gustav
0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
Gustav is correct; the command hides the database window.

Jim.
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Have you added the database location as a Trusted Location? This can be accomplished several ways - see the Article from MacroShadow here:

http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/A_10805-Overcome-the-Trust-Center-Nuisance.html
0
 
M_EpsteinAuthor Commented:
Sorry, I was away for a while.
Jeff:
Here is the autoexec macro:
auto exec macro
0
 
M_EpsteinAuthor Commented:
Gustav:
What is the best way to hide the database window?
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Have you tried the other suggestions, like the Trusted Location? This is a common issue and if not resolved, will not allow code (or macros) to run.

Your AutoExec looks okay, but you might try disabling it (just rename it temporarily).

If you do that, does the db start?
0
 
Gustav BrockCIOCommented:
There is no database window in A2013. Do you mean the Navigation Pane at the left?

/gustav
0
 
Gustav BrockCIOCommented:
Found some code to toggle this:
Public Function EnableNavigationPane(Optional ByVal varEnable As Variant) As Boolean

' Set or toggle if the Navigation Pane should be visible or not.
' Requirement: At least one form must exist in the database.
'
' 2012-10-24. Cactus Data ApS, CPH.
'
' Can be used with AutoKeys macro to be toggled with key combination Ctrl+F2 '
' Import AutoKeys by saving the following lines as a text file.
' Remove leading single quotes.
' Run this command:
'   LoadFromText acMacro, "AutoKeys", "d:\path\autokeys.txt"

'Version =196611
'PublishOption =1
'ColumnsShown =0
'Begin
'    MacroName ="^{F2}"
'    Action ="RunCode"
'    Argument ="EnableNavigationPane()"
'End
'Begin
'    Comment ="_AXL:<?xml version=\"1.0\" encoding=\"UTF-16\"standalone=\"no\"?>\015\012<UserI"
'        "nterfaceMacro MinimumClientDesignVersion=\"14.0.0000.0000\"xmlns=\"http://schem"
'        "as.microsoft.com/office/accessservices/2009/11/application\"xmlns:a=\"http://sc"
'        "hemas.microsoft.com/office/acc"
'End
'Begin
'    Comment ="_AXL:essservices/2009/11/forms\"><Statements/><SubName=\"^{F2}\"><Statements><A"
'        "ction Name=\"RunCode\"><Argument
Name=\"FunctionName\">EnableNavigationPane()</A"
'        "rgument></Action></Statements></Sub></UserInterfaceMacro>"
'End
    

    Static strForm      As String
    Static booEnabled   As Boolean
    
    On Error Resume Next
    
    If strForm = "" Then
        ' Find and store name of first form.
        strForm = DBEngine(0)(0).Containers!Forms.Documents(0).Name
    End If
    If Not IsMissing(varEnable) Then
        booEnabled = Not CBool(varEnable)
    End If
    
    DoCmd.SelectObject acForm, strForm, True
    If booEnabled = True Then
        DoCmd.RunCommand acCmdWindowHide
    End If
    booEnabled = Not booEnabled
    
    EnableNavigationPane = booEnabled
    
End Function

Open in new window

This adds the option to toggle the Navigation Pane in A2010 by pressing Ctrl+F2.
I haven't tested it in A2013.

/gustav
0
 
Jeffrey CoachmanCommented:
FWIW,

I stopped using "EchoOn" years ago.
Not sure how (or if) it works the same in Off2013
As a quick test, you can try deleting both "EchoOn" commands.

Also, ...things like hiding the database window can now be done in the Access options (then there is no reason to do them via macro)
screen
Then, ...all your macro seems to be doing is opening two forms, then maximizing them...

JeffCoachman
0
 
M_EpsteinAuthor Commented:
All excellent tips and tricks. I got rid of the macro, no more autoexec and everything worked great. The references was the next place I was going to look - usually you get an error message that tips you off on that one. All is good now, so far.. Thank you everyone. Sorry it took so long to finish this question ....
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.

  • 6
  • 4
  • 4
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now