views:

171

answers:

3

I have a Access ADP Project that has been a continus project for the last 6 years, so it has hundreds of forms and thosands line of VBA code. After a recent update it not wont compile to create the ADE file. It tells me one of the text boxes does not exist but it does. I deleted the for and re imported it from a working backup and still the same error. I have tryed Importing the whole project into a new ADP file and still wont compile, tryed compact and repair and also /decompile

Does anyone no of any tricks or software package to help fix this problem?

+1  A: 

Sometimes it helps to start a new, empty project and then import all forms/reports/modules from the old one.

birger
This may be useful, even though it refers to mdbs: http://www.granite.ab.ca/access/corruptmdbs.htm
Remou
Agree with importing to a fresh database.
Remou
A: 

If birger's approach doesn't do the trick, consider saving each module using the SaveAsText method. Then, as birger suggested, import, but ONLY the forms, and tables. Then, recreate the modules, using the LoadFromText method.

Stan Scott
+1  A: 

I don't work with ADPs, but in MDBs, there are differences between these two syntaxes for referring to controls on a form:

  Me.MyControl
  Me!MyControl

The first causes Access to create a hidden property that returns the control. The result of this is compile-time checking of references to controls.

The second uses the default collection of the current form and does not provide compile-time checking.

I assume that VBA works the same in ADPs as in MDBs, so why not try converting the offending control references to bang instead of dot? This would eliminate the compile-time checking and might allow the project to compile without having to reconstruct it laboriously.

If that works, I think I would then try deleting the control (to removed the hidden property definition) and add the control back with a new name and then compact (I don't know if ADPs can be decompiled, but if they can, it should be decompiled as well). Theoretically, this should remove the problematic hidden property definition permanently and if that's the cause of the problem, you should be able to revert to the dot operator and get compile-time checking back.

For what it's worth, I've seen too many corruption problems with the dot operator and always use the bang in all my projects. I'm OK with not having compile-time checking of control references.

And, oh, BTW, with the bang you lose automatic Intellisense (which in some cases is a blessing as Intellisense can get in your way in some contexts), but you can invoke a different Intellisense list with CTRL-SPACE. This list is not limited to the control type, but once you start typing, you get the usual autocomplete that jumps you to the appropriate location in the list.

David-W-Fenton