database closes when report is modified

prasadgov

Member
Local time
, 21:27
Joined
Oct 12, 2021
Messages
120
Hi All,

I have this issue of Access database closing, when I try to delete a control or a subform from an existing Report, while trying to edit or modify. Recently the organization's name in header and the signee in the Detail section changed and needs to be modified in all the reports.
The Access version is,
Microsoft® Access® for Microsoft 365 MSO (Version 2408 Build 16.0.17928.20114) 32-bit.

I compacted and repaired the database but it did not resolve. If I minimize the control and make it not visible, I can add the new control or sub report! but since there are huge number of reports, It would be time consuming.

TIA
GP
 
Last edited:
Perhaps consider putting those details in a table and retrieve the data on report Open/Load?
That will help for the next time.
Try importing into a new dB, everything but the reports and then the reports one by one.
 
You can also try to decompile the program file first, before doing a complete rebuild, and see if that makes a difference. During development I fairly commonly get the same crashy kind of behaviour you describe.

I keep a shortcut on my desktop with this as the Target...
Code:
"C:\Program Files\Microsoft Office\root\Office16\MSACCESS.EXE" /decompile
... which is the path to the MS Access program file, and a /decompile switch at the end. I'm pretty sure you can find this path on your machine by doing this in the immediate pane...
Code:
? references.Item("Access").fullpath
Then replace the filename MSACC.OLB with MSACCESS.EXE and add the /decompile switch.

Finally, if you open MS Access from that shortcut, and then open your database, all previously compiled code is discarded. Then close the file, and re-open it directly, and Access will recompile it from scratch.

The problem, as I understand it, is that Access does incremental compilation of VBA modules. It's possible, therefore, that when you edit code, Access may only recompile the module you edited. But if the edit you made changes, say, the signature of a function call that a different module will make, and Access doesn't recompile that module too, then you'll get a crash when the unedited module calls the edited one.

I am not certain how accurate that previous paragraph is, but I do find that if I have a crashy file, and I do this /decompile step, it commonly fixes the problem, and it's a lot easier than a complete rebuild.

hth.
 

Users who are viewing this thread

Back
Top Bottom