Solved

MS Access 2003 - The Expression on click / on unload error

Posted on 2012-04-04
24
369 Views
Last Modified: 2012-04-22
Hi,

I am getting above error while clicking on any button or closing any form.

I tried Compact and Repair. Importing all items in a new database.

It's  working fine in 2007.

PFA the screen shot.

Regards,
Sandesh
MS-Access-Error.jpg
0
Comment
Question by:Sandesh555
  • 8
  • 8
  • 4
  • +2
24 Comments
 
LVL 22

Expert Comment

by:Kelvin Sparks
Comment Utility
THis usually means you have a code error/corruption or a reference is missing.

Toheck references, in any code module, goto menu tools>references. Look for any that are marked as missing. You must file the file (dll, ocx etc...) and select it and ernsure it shows as selected.

Then try an compile the database - Menu Debug>Compile


Kelvin
0
 

Author Comment

by:Sandesh555
Comment Utility
Hi Kelvin,

All references are ok, how to find if there is any corruption.

Regards,
Sandesh
0
 
LVL 22

Expert Comment

by:Kelvin Sparks
Comment Utility
Can you complie the database?

Kelvin
0
 
LVL 22

Expert Comment

by:Kelvin Sparks
Comment Utility
Can you compile the database (typo above)
0
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Has this database ever worked on Access 2003 systems, or is this a new problem?

Can you post a little more detail about what leads to this error - which forms/buttons/etc...

And if possible post a sample copy of your database.
0
 

Author Comment

by:Sandesh555
Comment Utility
Hi,

Yes I can compile the database. Earlier it was working but suddenly started giving this error. It's giving this error on each event.
PFA the database.
Regards,
Sandesh
Expedite-V1.2.zip
0
 
LVL 77

Expert Comment

by:peter57r
Comment Utility
You'll have to post a version that does not have a vba password.
0
 

Author Comment

by:Sandesh555
Comment Utility
0
 
LVL 61

Accepted Solution

by:
mbizup earned 333 total points
Comment Utility
I agree that there is some form of corruption in that database.

If you remove and then re-paste  (take them out and then put them back in  again) the on click, on load, or other events that are causing this error, you'll find that they will start wotking normally again.

I haven't tried this, but before going through all the effort of removing and restoring your code, you might try decompiling it.  See the instructions here - and make a backup first:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_27661663.html
0
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Also,  I don't know if this caused the problem or not, but since you are developing a database for users with different versions of Access, make sure that all of your development is done in the lowest version.

In other words, if you are mixing Access 2003 and Access 2007, all of your development should be done in Access 2003.
0
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 167 total points
Comment Utility
There is some form of corruption which can be fixed using a decompile.
Use a copy of your database and execute the following command (adjusted for your own folder locations) from the Run dialog.

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "databasefolder\Rio Tinto - Expedite V1.2.mdb" /decompile
0
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Sorry - I gave you the wrong link.  These are the decompile instructions I'd meant to post:

http://www.granite.ab.ca/access/decompile.htm
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
Comment Utility
Giving credit where credit is due, you might want to try MX's solution and close Access, then reboot your computer.

Dale
0
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Dale,

Did you download the DB and try that?  It doesn't work for me.

MX's rebooting idea clears phantom breakpoints, which looks to me like a different problem (this one is resolvable by cut/pasting the code, and I imagine by decompiling too).
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
Comment Utility
Miriam,

No, cannot download while I'm at work.  I would concur that a decompile is in order.

But whenever I run into one of those situations that just doesn't make sense, where something I know should work isn't, I blame it on Windows and try rebooting.
0
 

Assisted Solution

by:Sandesh555
Sandesh555 earned 0 total points
Comment Utility
Hi Team,

This MS access 2003 db is using MS Access 12.0 object library reference.

Is it causing problem? and how to change the reference from 12 to 11.
It says object in use while removing the reference and did not add 11 while 12 is already there.

Please suggest.

Regards,
Sandesh
0
 
LVL 22

Expert Comment

by:Kelvin Sparks
Comment Utility
You have to make sure that no code is running. Start the database, holding down the shift key to ensure no autoexec macro runs. Then goto a VBA page (any one) and deselect the 12 version, then scroll down and find the 11 version. May pay to check it is installed first.


Kelvin
0
 

Author Comment

by:Sandesh555
Comment Utility
Hi Kelvin,

I could not able to remove reference, as it says cant remove control or reference: in use.

Regards,
Sandesh
0
 
LVL 61

Assisted Solution

by:mbizup
mbizup earned 333 total points
Comment Utility
Did you try cutting / pasting a block of code as suggested earlier?

This minor edit fixed the corruption for me in your sample.
0
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
(I did the edit on an Access 2003 machine,  btw )
0
 

Author Comment

by:Sandesh555
Comment Utility
Thanks
0
 

Author Comment

by:Sandesh555
Comment Utility
NA
0
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Sandesh - are you having trouble with  EE's user interface?

Click the Request Attention button if you need a Moderator's help.
0
 

Author Closing Comment

by:Sandesh555
Comment Utility
Thanks
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

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

10 Experts available now in Live!

Get 1:1 Help Now