Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inconsistent results of Debug... Compile

Status
Not open for further replies.

marklenel

Technical User
Aug 29, 2003
46
GB
Having inherited an MS Access database from the original programmer I have been making some very insubstantial tweaks to some VBA code sitting behind a number of forms.

On one particular form it is throwing up an error due to the Option Explicit statement and some undeclared variables. This is confirmed using the Debug... Compile tool.

However, using Debug... Compile on the original form (before tweaking) throws up no errors, and undeclared variables are passed without any issue.

The tweaks I made to the code were really insubstantial and I'm convinced they are not contributing to the problem.

I'd welcome any suggestions as to why this difference in the old and revised versions of the form is appearing.

Thanks.

 
Remove the Option Explicit statement if you don't want to deal with all the undeclared variables. Access won't compile a module unless it dirty, which is why the errors arise only when you "tweak" it.

If the code runs with undeclared variables, it was almost certainly compiled without using the Option Explicit statement.

Have you done a "Compact and Repair" to see what else won't compile?

VBSlammer
redinvader3walking.gif

[sleeping]Unemployed in Houston, Texas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top