Well, no, haven't tried that. it's just an import operation in the new database, correct?
Ajax, not sure what you mean.
Well, no, haven't tried that. it's just an import operation in the new database, correct?
Ajax, not sure what you mean.
You could try decompiling your dB. These are the steps I use to decompile my databases.
First, there are 2 parts of the decompile command. The first is the path to MSACCESS.EXE. The second is the path to the dB you want to decompile.
The path to MY msaccess.exe is "C:\Program Files\Microsoft Office\Office14\MSACCESS.EXE"
The path to my dB is "C:\Forum\cars\db1.accdb"
Note the double quotes. They are required. The first part and the second part are separated with a space.
Second, you MUST have access to the RUN command in the windows start menu.
Now the steps:
1) Make a backup of your database <<-- very important!!!
2) Hold the shift key down and open your dB.
3) Holding the shift key down, do a "Compact & Repair".
4) Close Access.
5) in Notepad, create the decompile command. Put the first part, the path to MSACCESS.EXE, a space, then the path to your dB.
It would look something like this:
NOTE the space between MSACCESS.EXE" and "C:\Forum !!!Code:"C:\Program Files\Microsoft Office\Office14\MSACCESS.EXE" "C:\Forum\cars\db1.accdb" /decompile
6) Copy the string in Notepad and paste it into the RUN command in the start menu.
7) Click on OK.
8) When the decompile is complete, hold down the shift key and open the database you just decompiled. If you don't hold down the shift key, then you might as well go back to step 3 and try again, since if the startup code (if any) runs, your code will recompile before you are ready to do so.
9) Holding the shift key down, do a "Compact & Repair".
10) Release the shift key after the "Compact & Repair" is finished. Open the VBE (ctl-G) and on the Debug menu, choose COMPILE [name of project].
11) On the file menu, save the project. (or use ctl-S)
12) Holding the shift key down, do a "Compact & Repair". Yes, again!
13) Close Access.
Why are all these steps necessary?
Because you want to not just decompile the VBA, you want to make sure that all the data pages where the compiled p-code was stored are completely discarded before you recompile.
Suggestions:
In the VBE, add the COMPILE button to your toolbar.
Compile often with that button on the toolbar, after every two or three lines of code.
DO NOT compile while code is running.... as in Single Step mode. This is a know cause of corruption in the VBA project.
Decompile is not something you should use all the time, but during heavy-duty coding, I might do a decompile a couple of times a day. And I generally decompile/recompile as the last step before releasing an app into production use.
------------------------
If this does not fix the problem, there is one more drastic option that might save you.
As always, Make a back up!!!
1) Create a new folder and name it something like "BackUp Code". This will be where you will save the code
2) You've made your back up... right???
3) Hold down the shift key and open the dB.
4) Open the IDE (ctl-G)
5) EXPORT EVERY MODULE... forms, reports and standard to the folder you created (ie "BackUp Code" or whatever you named it)
6) After you export a module delete it.
7) After all modules are exported/deleted, open each form in design view, open the properties sheet, click on the OTHER tab, find the "Has Module" property and set it to NO. Save the form/report.
8) Do the procedure above for decompiling.
9) Open the dB, Holding the shift key down, just in case you have an autoexe macro
10) Now is the time to import the code back into the dB. Open the IDE
11) On the file menu, click "Import File".... (this is why you created the folder) and import the modules
12) After EACH import, do a DEBUG/compile.
13) After all of the modules have been imported, do a "Compact & Repair"
You might have to open each form and check to see if the form events/button click code has reconnected (I don't remember - it has been a while since I've had to do this drastic of a step).
After a week of effort (and a lot of throwing up), I managed to save my dB (mdb - A2000 format).
"But what about your backups??" you ask.
The data was safe in the BE, but all of my FE backups (8) were corrupt. The corruption creeps up on you over time. I was still able to see the code, soooo... happy days!!
you may want to take a copy of the file before doing this, just to be on the safe side although I have never had a problem.
Not essential but you may also want to compact the db before starting and take a note of the file size after compacting.
When ready, open access with this command line (or paste into a shortcut). Note the path to access on your machine may be different and don't forget the space before /decompile
"C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE" /decompile
When access opens, select the problem db and open it - it will be opened decompiled
Next thing to do is compact it - it will reduce in size - for interest compare the size with what it was before you compacted it
Final thing to do is to go into the vba editor and compile the code again (Debug>compile), and then save. File size will increase a little bit but should still be smaller than before you started the process
I have a shortcut as above and decompile on a regular basis when developing anything.
Whole thing takes just a few seconds
As mentioned before, ensure all modules have at the top
Option Compare Database
Option Explicit
Google 'access decompile' to find out more about the above.
So far as I am aware you have not clarified on this or the other thread whether or not the db is split and each user has their own copy of the front end. If not split or is but users share the front end then that is probably why you have this problem - it is typical of the sort of corruption that can occur when multiple users share the same front end. The implication from your comment in your initial post 'Now, myself and other users have the same problem' is that users are sharing the front end.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
orange: well, the problem came back again, so I create a new database and we will see how long that works. I am getting frustrated with Access, lol.