Uncompiled Form/Report Module after LoadFromText

@

@Alex

Little presentation of scenario...

I Open with Automation external Access Application and here external MDB.
In this Object i use LoadFromText method to load from(previously exported with SaveAsText...)

This procedure work fine al function good also if i open the form...
But... after IMPORT ACTION i have to modify some Line of code, so i use VBEditor(with correct reference) Module and i get ERROR.

Set VBProj = App.VBE.ActiveVBProject
Set VBComp = VBProj.VBComponents(strModule) <---- HERE
Set CodeMod = VBComp.CodeModule

This error(7961) due tu impossibility to access to the MODULE.
Looks like the Module is not recognized, and probably is true...!

So i STOP all automation, i manual OPEN the external MDB and the Imported Form in design time to access to his module, i MANUAL COMPILE the module after insert 2 nullstring line at the end to force Compile(Enabling).

So NO REAL CHANGES were made.

After, i try again with automation and All Work good.

So i try lot of ACTIONS with NO ONE RESULTS:

1) COMPILE
Open one module and comile all:
objApp.DoCmd.RunCommand acCmdCompileAndSaveAllModules

2) COMPACTREPAIR Database
Application.CompactRepair(OldName, NewTempName)

3) COMPACT
Shell SysCmd(acSysCmdAccessDir) & "MsAccess.Exe " & _
"""" & Databasename & """" & "/compact"
4) DECOMPILE
Shell SysCmd(acSysCmdAccessDir) & "MsAccess.Exe " & _
"""" & Databasename & """" & "/decompile"

5) I would try to emulate manual Action, insert some empty line and then compile... but as i said before no access allowed to Code Module in this case...!

No more ideas... i'm STOPING HERE...
Some more suggestion will be very very important.

Thanks in advance.
@Alex
 

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