The Compile Access VBA and the need to decompile your code can significantly reduce the file size of your Access database and also resolves corruptions (if found).
Microsoft Access stores VBA code as both source and compiled code and sometimes some of the compiled VBA code can become corrupt meaning it needs to be flushed or rinsed clean.
Therefore, running Microsoft Access in a “decompile” mode causes all the compiled VBA code to be flagged as invalid which then is removed.
Once this happens and the compiled code has been removed, the database size is also significantly reduced when the database is onece again compacted.
Compile Access? What About Decompiling Microsoft Access Databases Too – How?
You will need to open your Access database using the “/decompile” switch (which is not widely documented) which will discard all the old VBA Access compile code, and leave just your Access VBA source code. You will then need to re-compile the VBA code again.
To decompile your Access database, follow these steps:
- From the Windows, Start, Run command line (or Windows key + R), type: msaccess.exe /decompile where msaccess.exe includes the complete path of your installed Microsoft Access database application i.e.
“C:Program FilesMicrosoft OfficeOffice14MSACCESS.EXE” /decompile - When Microsoft Access opens, open the database you want to decompile making sure any trusted locations and securities are enabled (where applicable).
- Navigate to any module (use ALT + F11) and run the Access Compile command which is found via the Debug menu and then save your changes.
- Go back to the database application and carry out a new Compact and Repair Database action (which varies between versions).
Now the database file size should be reduced and any strange errors related to the Access VBA code has been resolved.
Tags: access compile, access vba, compile access, complie access vba code, how to decompile ms access, ms access tools