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
Solved

Expression error while trying to open an Access Database

Posted on 2006-06-30
11
1,973 Views
Last Modified: 2012-05-05
I am receiving the following error when trying to open a specific access file:

The expression On Open you entered as the event property setting produced the following error: There was a problem referencing a property or method of the object.
* The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].
* There may have been an error evaluating the function, event, or macro.

However, when I try to open this file from another computer on the network, it opens with no problem.  Both machines are running XP Operating System and Office XP.
0
Comment
Question by:Siarra
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 17020104
Sounds like on that specific pc there is a reference missing.

Go to that pc, open the app with Shift button held down.
Then in the Databases window ({f11} if it doesn't show automatically) go to Modules tab and double-click on any code module.
Then go to Tools menu, References..., and in the References dialog see if there is any reference checked that has a prefix of 'MISSING: '
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17020123
Apart from what Jim said
can u go into VBA and do a debug/compile
does it fall over anywhere
if no errors then nothing will happen
0
 

Author Comment

by:Siarra
ID: 17020133
It is an *.mde file.  When I go to the modules tab and try to open any code module I get the error:

"you can't import, export, create, modify, or rename any forms, reports, pages or modules in an mde database."
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 65

Expert Comment

by:Jim Horn
ID: 17020146
The only thing you can really do here is to put the .mdb file (that created the .mde) on that machine, and repeat the steps I listed above.
0
 

Author Comment

by:Siarra
ID: 17020204
Same thing.  I am opening the .MDB file rather than the .MDE, and I still get the same error mentioned in my previous comment.
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 17020241
Just to clarify...

I am opening the .MDB file rather than the .MDE, and I still get the "you can't import, export, create, modify, or rename any forms, reports, pages or modules in an mde database." error message?
0
 

Author Comment

by:Siarra
ID: 17020288
Yes.
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 17020582
Sounds like someone renamed his mde extension to mdb.
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 17020594
The expression On Open you entered as the event property setting produced the following error: There was a problem referencing a property or method of the object.

I have gotten this from time to time if a linked table has dropped out of my programs database. My on open macro tries to execute a module that involves a linked table and it fails. Since it's run-time, the error messages aren't all that specific. Just a thought.
J
0
 

Author Comment

by:Siarra
ID: 17020726
When I opened the database as Jim requested earlier (holding the shift key), I tried to open one of the table just for general purpose, and it gave me an error that it could not open because 'X' path could not be found.
I guess the person who created the DB had it linked to another file on a network drive.  We were experiencing network problems earlier and although my network drive showed that it was mapped, it did not have a connection with the file server.  Once I remapped the drive, I was able to open the file with no problem.  Thank you all for your help.
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 17020782
In that case, it sounds like a table refresh issue, which you manually resolved.

If you want your app to programatically relink tables, here's a code function that would allow your app to do it automatically (uses DAO):

Function fncRelink()
'
Dim td As DAO.TableDef

For Each td In CurrentDb.TableDefs
  If Len(td.Connect) > 0 Then
     td.Connect = ";DATABASE=" & Left(CurrentDb.Name, InStrRev(CurrentDb.Name, "\")) & Mid(td.Connect, InStrRev(td.Connect, "\") + 1)
     td.RefreshLink
  End If
Next

MsgBox "Ready, tables relinked"

End Function

(Source: http://www.experts-exchange.com/Databases/MS_Access/Q_21260038.html#12945142 )

Thanks for the grade.  Good luck with your project.  -Jim
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
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…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

856 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