Solved

OnOpen error in Access 2010

Posted on 2013-02-04
3
4,081 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

Suggested Solutions

Title # Comments Views Activity
Any Way to Print an Import Spec? 3 28
Help Required 3 90
Access check if a table is open 4 38
IIF help, YN field 7 21
This is an explanation of a simple data model to help parse a JSON feed
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

813 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

13 Experts available now in Live!

Get 1:1 Help Now