Error messages as if "Option Explicit" were declared, but it isn't

T

Tim Green

Hi,

I have a database that I and one other user access. I run reports, she does
data entry. We've both been using the db for over a year, and I've made no
recent modifications. As of today, she is unable to process, because I have
some validation code on the back-end of the data entry form that generates
errors. It fails exactly as if "Option Explicit" were declared, but it isn't.
It works fine on my computer, but I was able to replicate the errors by
introducing the Option Explicit statement. The error message may be the same,
or may be different, I don't have access to her machine at the moment to
check, but it certainly fails at the same points in both cases.

I developed the db in Access 2003, and my colleague still uses that, but I'm
now on 2007.

I'd rather not trawl through every subroutine and explicitly declare all of
my variables. That may be good practice, but I don't want to introduce errors
into a perfectly good working database at this stage.

Does anybody have any idea where to start with this?
 
T

Tom van Stiphout

On Thu, 3 Jun 2010 05:44:12 -0700, Tim Green

I am not going to lecture you on the use of Option Explicit. You seem
to know the dangers and are willing to live with the consequences.
It's a free country.
Maybe something changed in the References. Perhaps their order, or
perhaps the other user got a newer version of one of them. This could
potentially cause code no longer to execute properly.

Also, please post the exact error message. We're kind of guessing
right now.

-Tom.
Microsoft Access MVP
 
D

David W. Fenton

Does anybody have any idea where to start with this?

Yes. Find a new job. If you don't want to fix the actual problem,
you should be doing something else.
 
R

RD

"As of today, she is unable to process, because I have
some validation code on the back-end of the data entry form that
generates errors."

" I don't want to introduce errors
into a perfectly good working database"

Huh?

Do the right thing. Set Option Explicit and fix your variables. While
you're at it, build in some error handling with informative messages.

Without knowing where it throws the error or even what the error(s)
is/are, nobody is going to be able to give you anything more
constructive than that.

Regards,
RD
 
R

ryguy7272

put these two lines right at the top of the module where the error is being
thrown:
Option Compare Database
Option Explicit

When you do that, it should be pretty obvious where the problem is. Also,
see this:
http://allenbrowne.com/ser-30.html
http://support.microsoft.com/kb/225878/en-us
http://www.pcreview.co.uk/forums/thread-3048860.php
http://www.access-programmers.co.uk/forums/showthread.php?t=109161

It takes just a couple seconds to do that and will likely save you countless
hours of frustration which often is the result of not doing that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top