Solved

Expression error while trying to open an Access Database

Posted on 2006-06-30
11
1,966 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 65

Expert Comment

by:Jim Horn
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 65

Expert Comment

by:Jim Horn
Comment Utility
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
Comment Utility
Yes.
0
 
LVL 34

Expert Comment

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

Expert Comment

by:jefftwilley
Comment Utility
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
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

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…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

11 Experts available now in Live!

Get 1:1 Help Now