X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Access Glitch Regarding Saving Code Changes, Any Version    
post Feb 19 2019, 03:50 AM

Posts: 412
Joined: 18-August 05
From: DFW, TX, USA

Found a troubling glitch in Access 2019 (and possibly other versions) regarding saving code changes.

Go to a code window, make a change, and then go to File, Save As, Back Up Database, and click the Save As button. You are prompted as to whether you want to save changes to your code module, which is correct.

Now create a new query, but don't save it. Then make a change to a code module.

Now, before doing the backup file steps, first press Ctrl+S in the code module to save the code. Access asks if you want to save changes to the two objects -- the code module and the unsaved query. Click Yes with both objects highlighted.

Access will then prompt you for the name to save the query as. Click Cancel there.

So now, nothing has yet been saved because we cancelled out of the save.

Now go to File, Save As, Back Up Database, and click the Save As button. This time you are not prompted if you want to save the code module. The database is closed and a backup copy is made, and then the database is reopened. Your code changes are lost.

Note that this doesn't happen with the manual closing of the database. If you do Ctrl+S in a code module, and then cancel when it prompts you for the query name, Access still knows that there are unsaved objects, and will prompt you if you want to save when you manually close the database.

However, if you perform those steps before doing a file backup, then Access loses track of the fact that there are unsaved objects, and your changes are lost.

This may seem like an obscure test, but it's not obscure at all. It actually happens to me a lot. I will make changes to code and press Ctrl+S to save my code, only to be prompted to save an unsaved query that I have no intention of saving. Oftentimes I'll just click Yes, and then cancel out when prompted for the query name, and then manually close the query without saving it. I then rely on Access to remember that there is unsaved code to be saved if I do a File, Save As, Backup File. But, unfortunately, it doesn't.

Accessing since '96
Go to the top of the page

Posts in this topic

Custom Search

RSSSearch   Top   Lo-Fi    20th January 2020 - 01:48 PM