1a) Create a shortcut with the following
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "d:\My Documents\access\mayapp.mdb" /decompile
As appropriate for your environment of course. Note that if your path to your MDB contains a space it must be enclosed in double quotes just as the MSACCESS.EXE component. You can create a short cut by right clicking in the directory of your choice, highlighting new and creating
or
1b) Create a one line .bat or .cmd line with the above text in it it using notepad.
Hint: Right click in your directory of choice, highlight new and select Text Document. You will be presented with a new file named "New Text Document.txt" or similar. Rename that file to something like "decompile.bat". Then right click that file and select edit. Notepad should then run opening up that file.
2) Click on the short cut or click on the .bat or .cmd file and, in Access 97, you'll get the message "... has converted the code in ... to your current version of Visual Basic". This message does not appear in Access 2000 or newer. Hold the shift key down when you click on Okay so the MDBs autoexec macro won't execute or the start-up form will not be opened. If you have any class modules exit the MDB and re-enter it. This will keep the class modules intact.
3) Now compact the MDB to clean out the old VBA code..
4) Hit Ctrl+G to open the debug/immediate window or go into any module and click on Debug. If Access 97 click on Compile and Save All Modules. If Access 2000 or newer click on Compile. Compiling is particularly important to see if there were any problems and for performance reasons.
5) Then compact again.