Error in On Open keeps coming back

P

Pam

In the course of debugging a form, the following error keeps coming up:

"The expression On Open that you entered as the event property contains the
following error: end of statement expected."

I can't find anything wrong with the Open procedure - and the odd thing is
that I wasn't even working on it - I was working on after update code for one
of the controls.

I managed to make the error go away by recreating the procedure and copying
the old code into. But, alas, the error continues to come back and this last
time my re-create process isn't working either.

The help message refers to Jet 4.0 sp8 and says that I should have it
installed - Windows Update does not offer it - how can I confirm that I have
it installed?

Does anyone have any ideas on what is causing this error and what I can do
to stop it?
 
A

Allen Browne

You can get the JET 4 service pack from either of these links:
http://support.microsoft.com/gp/sp
http://support.microsoft.com/kb/239114

A couple of other possible causes of this problem:
1. Name AutoCorrect
This is always a suspect where Access gets the names of things confused, and
the intermittent problem you describe sounds like that. Uncheck the boxes
under:
Tools | Options | General | Name AutoCorrect
Then compact the database:
Tools | Database Utilities | Compact
Explanation of why:
http://allenbrowne.com/bug-03.html

2. References
If you are still stuck after the JET 4 SP and disabling Name AutoCorrect,
try simplifying your references:
Open a code window.
Choose References from the Tools menu.
Uncheck any references you do not need.
For a list of the ones you typically need in your version of Access, see:
http://allenbrowne.com/ser-38.html
Still in the code window, choose Compile from the Debug menu.
Fix any errors, and repeat until it compiles okay.

3. Naming clash
If you are still stuck, you may have something that has the same name as a
reserved word or built-in property. Reply to this thread if the above don't
fix the issue and you need more on this.
 
P

Pam

Thanks, Allen - this is fabulous information.

fyi - I found my problem - my touchpad has a sticky something or other
feature that sometimes seems to have a mind of it's own - I had turned the
first line of my module into 'meOption Compare Database' and I didn't realize
it.
 
Top