Solved

OnOpen error in Access 2010

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

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

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

705 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

18 Experts available now in Live!

Get 1:1 Help Now