Solved

Expression error while trying to open an Access Database

Posted on 2006-06-30
11
1,979 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
[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
  • 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
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.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sIMULTANEOUS USAGE ON NETWORK-ACCESS 2010-2013 7 77
Intermittent OleDbConnection Error 20 53
Export individual report to pdf 2 40
Outlook mail to Access 8 25
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

738 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