Solved Code not save when at runtime

atzdgreat

Member
Local time
Today, 13:48
Joined
Sep 5, 2019
Messages
42
Hi all does anyone experience about losing their codes even though it was already saved once the form runs or even close. it's like once closing the form, its doing undo.
 
Are you saying that you make code changes when you implement a code fix, switch to Form View mode, and then close the form? And after that sequence, the code changes are not saved?

Or were you describing something else?

Which version of Access are you running?
 
You said "code," but did you actually mean to say "data?"
 
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
 
No. Upload your DB for someone else to test.
 
You should get a "do you want to save your changes?" type message. Maybe you have setwarnings set to off. That might cause your changes to be dropped. Also, if your code closes the form with the setting to not save changes, that might have the same effect also. (I think it's AcSaveChangesNo which refers to saving design changes, not data changes)

One other thing I am not sure about is whether you are getting these issues when running normally, or during development. I tend to issue accde versions, and then code can't be changed. It has to be changed in the development code version, and that version reissued as a new accde. For databases I use myself only, I do make changes during use. The only time I lose them is if my code gets stuck in a loop which I can't stop, and then I can't save the changes. Then I have to repeat the edits and remember to save them before running code. :D
 
Yes, I got in the habit of a Ctrl + S, before trying to run anything. :)
 
I'm thinking that Dave has point about warnings being disabled because I frequently get the "do you want to save changes" question when working on my standalone apps. In fact, that was on my mind when I asked my question for clarification, because you SHOULD be reminded by Access that you have changes pending. This might be something altered via the File >> Options >> Current Database option page although there ARE a few other places where you can make changes to behavioral options.
 
Hi all does anyone experience about losing their codes even though it was already saved once the form runs or even close. it's like once closing the form, its doing undo.
Yes I did.

I thought I got the hang of it after a while, but I found out I was mistaken and none the wiser. Generally, the chances of my codes not saved can be rather random.

Also, using the Ctrl-S keys to save the project mid-way a game is not appropriate. If I discovered that my drink has a fly in it, the bug mid-operation, and I needed to work on the situation at once to avoid losing it completely a few hours a days later. Not being enticed to type Ctrl-S allows me to return to the original codes by shutting down and rebooting.


BR.
Ed
 
NEVER run code unless you have saved it first.
If it crashes or you close the database, all those code changes will be lost
I won't share all of the details about why I know this to be a true statement, but it does involve a significant volume of curse words and keyboard practice while retyping those code changes.
 
And of course I only know to do this from the multiple times I’ve forgotten, run my updated code and lost all my changes.
 
NEVER run code unless you have saved it first.
If it crashes or you close the database, all those code changes will be lost
That became ingrained in my muscle memory decades ago. I can't help but press Ctrl-S every few seconds (and compile first).

I'm sure I've even pressed Ctrl-S on my wife in the middle of the night... 😅 😇
 
And of course I only know to do this from the multiple times I’ve forgotten, run my updated code and lost all my changes.
It has happened to me a few times that I have changed or corrected code in a referenced ACCDB. After closing Access, it was reliably gone. 🤪
 

Users who are viewing this thread

Back
Top Bottom