Solved

Expression error while trying to open an Access Database

Posted on 2006-06-30
11
1,972 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

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…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views 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 Access…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

803 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