Can someone explain this error message?

  • Thread starter Thread starter Neal Tipton
  • Start date Start date
N

Neal Tipton

Please tell me why I get the following:

The expression OnOpen you intered as the event property setting produced the
following error: A problem occurred while
Microsoft 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 funcion, or [Event Procedure].
* There may have been an error in evaluating the function, event, or macro.


The OnOpen code is simply a test code that reads:
Debug.Print "Opened successfully"

It may help you to know that when I originally started building this form I
created a command button and when I pushed the "..." button to go to the
code builder, I got the code for another form. The form I was working with
did not even appear on the list under the "More Windows" pull down menu. I
can't remember how I eventually got to get a code page to open up for the
form. When I did, and I wrote the code for the button I was creating, upon
testing it I got the same message as above, only it said, "OnClick" instead
of "OnOpen."
What gives?

Neal
 
Neal Tipton said:
Please tell me why I get the following:

The expression OnOpen you intered as the event property setting
produced the following error: A problem occurred while
Microsoft 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 funcion, or [Event Procedure].
* There may have been an error in evaluating the function, event, or
macro.


The OnOpen code is simply a test code that reads:
Debug.Print "Opened successfully"

It may help you to know that when I originally started building this
form I created a command button and when I pushed the "..." button to
go to the code builder, I got the code for another form. The form I
was working with did not even appear on the list under the "More
Windows" pull down menu. I can't remember how I eventually got to
get a code page to open up for the form. When I did, and I wrote the
code for the button I was creating, upon testing it I got the same
message as above, only it said, "OnClick" instead of "OnOpen."
What gives?

Neal

It sounds to me as though your VB project may be corrupt. If I were in
your position I would

1. Make a backup of the database.

2. Decompile the database, by running a command line like

msaccess /decompile "C:\Path To\YourDB.mdb"

3. Compact the database.

4. Compile the database.

5. Compact it again.

Then see if the problem has goine away.
 
Back
Top