Solved Code not save when at runtime

I can't help but press Ctrl-S every few seconds (and compile first).
Tip: you can run Compile from the keyboard (and Comment and Uncomment block).

• Put your IDE menus into design view
• Drop a toolbar command onto the main menu
• Customize the name to include an ampersand (&) character preceding the key you want as a short-cut
• Return menus to normal
• Hit <Alt>, release <Alt>, then hit < your short-cut key >

As per the image below, to compile I hit <Alt>, release <Alt>, and hit <L>.

So my "every ten seconds or so" pattern is...
• <Ctrl>+S
• <Alt>
• L

Screenshot 2025-12-16 112101.png
 
1766067588195.png


Dear all, I have finally come across a post by someone who seems to be experiencing the same problem that I have. Basically, I believe that Access crash and restart so smoothly that I had no idea that the relaunched instance is locked down by the 'Admin' and after many more hours of work, I may or may not be able to save the app. I am also working on office automation right now and the problem mostly shows up as being blocked by another user, despite there being only I who was working on it. It has taken me a long time to suspect this was due Access restarting itself, but I have no way of verifying it. You know how it is with a random and not infrequent problem with an app you are working on, I have started to dismantle some of the work I have done, test some new scripts until the original codes are barely recognizable, and I may or may not be able to just replace the codes with an original because I would want to keep some of the patchy work. On some lonely, I would be frantically trying to recover the app from the injury I afflicted it with in my attempt nail down the problem.

Anyway, the post I copied from the writer's Facebook brings such relief, I am no longer alone in my experience , and I am not imagining things and am probably still sane. Can anyone shed light on this? I strongly feel it is a Win 11 thing, you know, the particular kind of meddling in other people's otherwise uneventful lives that so characterises Microsoft...
 
View attachment 122661
Dear all, I have finally come across a post by someone who seems to be experiencing the same problem that I have. Basically, I believe that Access crash and restart so smoothly that I had no idea that the relaunched instance is locked down by the 'Admin'
and after many more hours of work,
I may or may not be able to save the app. I am also working on office automation right now and the problem mostly shows up as being blocked by another user, despite there being only I who was working on it. It has taken me a long time to suspect this was due Access restarting itself, but I have no way of verifying it. You know how it is with a random and not infrequent problem with an app you are working on, I have started to dismantle some of the work I have done, test some new scripts until the original codes are barely recognizable, and I may or may not be able to just replace the codes with an original because I would want to keep some of the patchy work. On some lonely, I would be frantically trying to recover the app from the injury I afflicted it with in my attempt nail down the problem.

Anyway, the
This is indeed a potential problem and one I've encountered recently.

The solution is to NOT continue uninterrupted coding over an extensive period without regular, frequent saves.

If you are actually working many hours between saves, maybe a different approach would be in order.
  • Start Access and immediately make a "pre-work state" backup of the accdb on which you are going to work.
  • At frequent intervals--say 3-5 minutes--save your work by
    • compiling the VBA
    • saving everything.
  • At somewhat longer intervals--say 8-10 minutes--make another backup.
At worst, you'll lose the most recent changes, changes that are more easily recalled than those from several hours earlier. At best, you'll realize the problem before you've invested hours of work.
 
This is indeed a potential problem and one I've encountered recently.

The solution is to NOT continue uninterrupted coding over an extensive period without regular, frequent saves.

If you are actually working many hours between saves, maybe a different approach would be in order.
  • Start Access and immediately make a "pre-work state" backup of the accdb on which you are going to work.
  • At frequent intervals--say 3-5 minutes--save your work by
    • compiling the VBA
    • saving everything.
  • At somewhat longer intervals--say 8-10 minutes--make another backup.
At worst, you'll lose the most recent changes, changes that are more easily recalled than those from several hours earlier. At best, you'll realize the problem before you've invested hours of work.
Yes, you make a good point, thanks. But we all need to get into that deep think state where we basically forget what's around us to do our best work and that's really one of the pleasure doing coding.
 
Yes, you make a good point, thanks. But we all need to get into that deep think state where we basically forget what's around us to do our best work and that's really one of the pleasure doing coding.
Once you switch from coding to testing, you will most likely fall out of the grove. But in any case adding a save step in regular intervals will quickly become automatic.

PS: I use source control with Access and make a point to commit changes with each new feature.
 
hi thank you for your reply. Yes @The_Doc_Man you're right when i implement a code fix then switching to view mode and then close the form, all the code changes are not saving. so currently what i'm doing right now is to close my access and recode before switching to view mode
...and it is random. Without changing any Access version and when working on the same form and codes, sometimes the code saves, and sometimes not. I know if there is an instance of the application running in the background, I cannot save the one I am working on. With no background application, it is still not saving the code randomly. There is no consistent pattern.

Nowadays, I accept the situation whenever this problem occurs, re-do all lost work doggedly, probably not sleeping or resting for the night, while feeling a knot in my stomach from the rage, yes, a rage, I suppress as I continue to suffer torment from Microsoft Office, Access and Win 11.
 
After reviewing this thread, another memory came to me. As an Access DB author/admin, I did a lot of code fixes and upgrades (not always in that order), but the record-keeping requirements of the Navy were such that I had to test one thing at a time and record the results of the work. It was a pain in the toches to track things that way, but a side effect was that the things I did had to be saved singly and tested at least on the test bench. The days of code-until-you-drop were long gone, a discarded relic of my college days. (How I ever finished that program for real-time data acquisition in PDP-11 assembly code, I'll never know.... but finish it, I did.)

Coding should be in limited increments for debug/test purposes - and for maintaining your sanity.

Just one old guy's opinion.
 

Users who are viewing this thread

Back
Top Bottom