Error message

DrMaestro

Registered User.
Local time
Today, 23:04
Joined
Feb 3, 2007
Messages
21
Hi,

I have the follwing problem: I created a form which has a button. When pressed (onclick) it searches a table to find the requested entry. I started to create the database using Access 2000. A collegue helped me with it at work using Access 2003. When I try to run it (click it) on Access 2003 (or Access 2002 on a different computer) everything works as intended (so there is no error in the code). But when I try it at home I get the following message:
"The expression On Click you entered as the event property setting produced the following error: A problem occured while Microsoft Office Access was communicating with the OLE server or ActiveX control.
* The expression may not result in the name of a macro, the name of a user-defined macro, or [Event procedure].
* There may have been an error evaluating the function, event or macro."

I also get the same error when I close the form (which has a code with OnClose statement, which exits Access when the form is closed). The only thing that changes is "The expression On Close....."

I can't understand where the problem is because the code works flawlessly in other computers, but not mine. Thanks for your interest.
 
You are likely suffering from a case of the "MISSING Reference." You need to open the VBA IDE Window (go to code window) and to to Tools / References and uncheck any that say MISSING, then close the dialog and restart your database.
 
Hi,

Thanks for your reply. I did as you advised. I don't see any reference marked "missing" in the references window. The options checked are as follows:
*Visual Basic for applications
*Microsoft Access 11.0 Object Library
*OLE Automation
*Microsoft DAO 3.6 object library
*Microsoft ActiveX Data Objects 2.1 Library

The help file mentions about "Visual basic objects and procedures" as a required and unremovable component but it is not included in the reference list. Is it the missing part?

Thanks again.
 
Hi DrMaestro,
It looks like Bob is on a break right now. Here's a good link for Reference problems which it looks like you have as Bob suggested.http://www.accessmvp.com/djsteele/AccessReferenceErrors.html
The first two references you have are the manditory ones and then I doubt you need both ADO and DAO references but that's your decision. OLE is also optional.

EDIT: I fibbed! Sorry Bob. PMFJI :o
 
Hi,

Thanks for your replys. I went to the link you provided and read the information. I tried the reference wizard database and it didn't give me any errors. Apparently there aren't any problems with missing references (i tried all of the suggested methods at the link http://www.accessmvp.com/djsteele/AccessReferenceErrors.html . Is it possible that some of the files are damaged? Or do you think there may be another problem. Also, a friend of mine has Office 2003. I borrowed it and installed to see if it will work and I still got the same problem. I then unistalled it. So, maybe there is a common windows file problem. Thanks.
 
Try creating a New empty mdb with Name AutoCorrect turned off and import everything from the other db and see if that solves any problems. It only takes a few seconds.
 
Hi RuralGuy and boblarson,

Thank you very much for your answers.

Try creating a New empty mdb with Name AutoCorrect turned off and import everything from the other db and see if that solves any problems. It only takes a few seconds.

I did as you advised. The same error still happens.

Check my post here for a possible solution (regarding Comctl32.ocx).
http://www.access-programmers.co.uk/...SING+Reference

As I mentioned previously, there is no reference marked as missing in references window. So I have no idea which file to browse for.

Thanks..
 
That is dissappointing. I would try unchecking the OLE Automation and ActiveX references and recompile and see if you get an error. If the problem goes away or stays the same then you didn't need those references anyway. You can always go back and check them again but I wouldn't unless you need them.
 
Okay, you didn't get my point in the post.

The Comctl32.ocx problem (or MSComctl.ocx also) can occur and NOT have MISSING listed in the references. Believe it, or not, you can still have this reference problem and it will NOT, I repeat, will NOT show up in the references list as MISSING. So, all you need to do is to click the BROWSE button in the references window and browse to wherever on your system those two files are, select them, and click okay. Those may not be the problem, but you can try that as it has been a source of issues in the past. Mostly it happened when different operating systems (say Win95 on one machine, Win98 on another or WinXP on one machine and Win2000 on another), but amazingly enough it has happened between XP machines as well.
 
Hi,

I unchecked OLE automation and the Active X reference, recompiled and ran again but I still get the same error. They are unchecked right now.

boblarson, thanks for the clarification. The 2 files mentioned were in windows' system32 directory. I downloaded their latest version from Microsoft's site and installed them. Then I went to Access, browsed the files and added them as references. They showed up as Microsoft Windows Common Controls 5.0 (SP2) and Microsoft Windows Common Controls 6.0 (SP6). Then I recompiled and restarted the database. I still get the same error.
 
Do you have *all* of the latest patches for Office applied on this machine?
 
I checked the office update site. Had a few new updates. Downloaded and installed all of them and restarted the computer as required. I tried to run the database again but I still get the same result. (very depressing)
 
Hi there, I have been tearing my hair out with this problem aswell. I created my database on my network in 2002 then converted it to 2000 to take to a different network which all seemed fine. I have played around with the references and recreating the database etc. but the error keeps reappearing in different places. No one seems to know why this happens or how to prevent it. It is not satisfactory to recreate the database every time this happens as data is being lost etc. Interestingly this problem was not as prominent in Access97.

Any help would be much appreciated.
 
I got this problem when I added a menu form. It has 3 command boxes; one to close the form and 2 to preview reports. One minute it was working and the next it gave the above error. Seems hopeless.
 
I just deleted and recreated the form and it went away. One thing I noticed was that the first time I created the form I tried to run it before I had saved it and the system objected. I wonder if this created the problem?
 

Users who are viewing this thread

Back
Top Bottom