Solved

OnOpen error in Access 2010

Posted on 2013-02-04
3
3,872 Views
Last Modified: 2013-02-04
I have an Access Database. I am using VBA to Open Forms, for example,

DoCmd.OpenForm "F_Contact"

This database has been working fine for several days but today I get an error

This error occurs when an event has failed to run because the location of the logic for the event cannot be evaluated. For example, if the OnOpen property of a form is set to =[Field], this error occurs because a macro or event name is expected to run when the event occurs.

See screenshot attached.
Error-in-Access.docx
0
Comment
Question by:DataTrain
3 Comments
 
LVL 47

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 75 total points
ID: 38850728
Open the VBA code window (CTRL-G).

Click Debug->Compile to compile your application.  This should find and highlight all of the errors in your code.  Fix each error, then try again (Debug->Compile), until it compiles without error.
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 75 total points
ID: 38850729
Do you have code running in the Open or Load event of the form?

You might try Compiling your code. To do that, open the Visual Basic Editor (Ctrl + F11) and click Debug - Compile. Fix any errors, and then Compact your database.
0
 

Author Closing Comment

by:DataTrain
ID: 38850907
It has started working again without me doing anything! I have taken on board your advice. Thanks.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

948 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

22 Experts available now in Live!

Get 1:1 Help Now