MS Access (Office 365) Command buttons do not work on a cloned DB

%3CLINGO-SUB%20id%3D%22lingo-sub-2209827%22%20slang%3D%22en-US%22%3EMS%20Access%20(Office%20365)%20Command%20buttons%20do%20not%20work%20on%20a%20cloned%20DB%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2209827%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20bookkeeping%20application.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEvery%20year%20I%20copy%20and%20paste%20the%20DB%20with%20a%20new%20name%20and%20remove%20the%20data%20from%20the%20tables%20relating%20to%20the%20bookkeeping%20entries%20of%20the%20previous%20year.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20time%20after%20I%20do%20this%20my%20command%20buttons%20do%20not%20work.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20example%2C%20a%20button%20to%20open%20a%20form%20using%20DoCmd.OpenForm%20does%20not%20work.%26nbsp%3B%20Some%20of%20the%20buttons%20open%20forms.%20Other%20buttons%20within%20an%20opened%20perform%20activate%20calculations.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2209827%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAccess%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2210073%22%20slang%3D%22en-US%22%3ERe%3A%20MS%20Access%20(Office%20365)%20Command%20buttons%20do%20not%20work%20on%20a%20cloned%20DB%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2210073%22%20slang%3D%22en-US%22%3EI%20can't%20say%20for%20sure%20why%20VBA%20would%20stop%20working.%3CBR%20%2F%3E%3CBR%20%2F%3EHowever%2C%20you%20have%20a%20serious%20design%20flaw%20here%20and%20that's%20a%20higher%20priority%20in%20the%20short%20run%3A%3CBR%20%2F%3E%22...copy%20and%20paste%20the%20DB%20with%20a%20new%20name%20and%20remove%20the%20data...%22%3CBR%20%2F%3E%3CBR%20%2F%3EOne%20of%20the%20most%20important%20features%20of%20an%20effective%20relational%20database%20application%20is%20that%20it%20is%20able%20to%20store%20HISTORY%2C%20history%20that%20can%20encompass%20years%20and%20years%20and%20years.%20Deleting%20data%20destroys%20history.%20For%20a%20bookkeeping%20application%20to%20destroy%20history%20is%20probably%20not%20in%20accord%20with%20good%20accounting%20practices.%3CBR%20%2F%3E%3CBR%20%2F%3EInstead%2C%20you%20should%20keep%20all%20of%20your%20history%20for%20things%20like%20year-to-year%20accounting.%3CBR%20%2F%3EIf%20you%20want%20to%20deactivate%20some%20records%2C%20you%20can%20easily%20do%20that%20by%20adding%20an%20Active%20field%20to%20the%20tables.%20This%20will%20be%20a%20Yes%2FNo%20field.%20At%20the%20end%20of%20the%20year%2C%20run%20an%20update%20query%20to%20change%20those%20records%20from%20%22Yes%22%20(meaning%20active)%20to%20%22No%22%20(meaning%20not%20active).%3CBR%20%2F%3E%3CBR%20%2F%3EBeyond%20that%2C%20if%20you%20have%20a%20valid%20bookkeeping%20application%2C%20every%20transaction%20already%20has%20a%20date%20field%20in%20it.%20You%20record%20a%20payment%20with%20the%20date%20of%20the%20payment.%20You%20record%20income%20with%20a%20date%20the%20income%20was%20received%2C%20and%20so%20on.%3CBR%20%2F%3E%3CBR%20%2F%3EAll%20you%20ever%20need%20to%20do%20is%20filter%20those%20tables%20for%20the%20records%20that%20apply%20to%20the%20CURRENT%20year%2C%20by%20adding%20a%20criteria%20to%20queries%20against%20that%20data%20which%20select%20current%20year%20records.%3CBR%20%2F%3ENo%20more%20risky%20copy%2Fpaste%2Fdelete%20needed.%3CBR%20%2F%3EThis%20is%20what%20I%20would%20really%20recommend%20you%20do.%3CBR%20%2F%3E%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3CBR%20%2F%3ENow%2C%20one%20could%20guess%20that%20perhaps%20the%20new%20accdb%20has%20been%20copied%20to%20a%20new%20location%20and%20that%20location%20has%20not%20been%20designated%20as%20a%20Trusted%20Location.%20That's%20one%20possibility.%20As%20noted%20above%2C%20it%20would%20probably%20require%20a%20copy%20of%20the%20non-functioning%20accdb%20to%20be%20able%20to%20trouble-shoot%20it.%3CBR%20%2F%3E%3CBR%20%2F%3EBut%20again%2C%20the%20more%20appropriate%20action%20will%20be%20to%20stop%20this%20process%20and%20instead%20implement%20a%20standard%20relational%20database%20application%20approach%20that%20relies%20on%20filtering%20of%20records%20by%20the%20date.%3CBR%20%2F%3E%3CBR%20%2F%3EBTW%3A%20if%20you've%20ever%20looked%20at%20accounting%20software%20like%20QuickBooks%2C%20you'll%20recognize%20that%20is%20how%20the%20professional%20bookkeeping%20software%20does%20it.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I have a bookkeeping application.

 

Every year I copy and paste the DB with a new name and remove the data from the tables relating to the bookkeeping entries of the previous year.

 

This time after I do this my command buttons do not work.

 

For example, a button to open a form using DoCmd.OpenForm does not work.  Some of the buttons open forms. Other buttons within an opened perform activate calculations.  

 

 

 

 

5 Replies
I can't say for sure why VBA would stop working.

However, you have a serious design flaw here and that's a higher priority in the short run:
"...copy and paste the DB with a new name and remove the data..."

One of the most important features of an effective relational database application is that it is able to store HISTORY, history that can encompass years and years and years. Deleting data destroys history. For a bookkeeping application to destroy history is probably not in accord with good accounting practices.

Instead, you should keep all of your history for things like year-to-year accounting.
If you want to deactivate some records, you can easily do that by adding an Active field to the tables. This will be a Yes/No field. At the end of the year, run an update query to change those records from "Yes" (meaning active) to "No" (meaning not active).

Beyond that, if you have a valid bookkeeping application, every transaction already has a date field in it. You record a payment with the date of the payment. You record income with a date the income was received, and so on.

All you ever need to do is filter those tables for the records that apply to the CURRENT year, by adding a criteria to queries against that data which select current year records.
No more risky copy/paste/delete needed.
This is what I would really recommend you do.
===============
Now, one could guess that perhaps the new accdb has been copied to a new location and that location has not been designated as a Trusted Location. That's one possibility. As noted above, it would probably require a copy of the non-functioning accdb to be able to trouble-shoot it.

But again, the more appropriate action will be to stop this process and instead implement a standard relational database application approach that relies on filtering of records by the date.

BTW: if you've ever looked at accounting software like QuickBooks, you'll recognize that is how the professional bookkeeping software does it.
Thank you for your reply and I very much appreciate your suggestion. A follow up question, which is based on a perhaps unwarranted desire for year to year data segregation. What do you think about the idea simply cloning the tables?

Regarding my primary DB (not bookkeeping), which also has command buttons as well make s use of the on-click within controls, I did an experiment. I copied and pasted the DB. I had the same issue. Command buttons and on-click of controls within forms do not work.

@Chuckz1947 

I am not an expert in accounting, but I don't think it's standard practice to segregate data year-to-year, PHYSICALLY. My bank certainly doesn't do that, nor do standard off-the-shelf accounting packages. So, while I am not going to be adamant, it does seem to be out-of-mainstream practice. Cloning tables is roughly the same thing, IMO. 

To focus, though, on this problem. I asked if the accdbs are both in a Trusted Location. It's also important to allow macros to run. Although the dialog refers only to macros, this does include VBA,TrustedLocations.png

Although that's the most likely source of this problem (one or the other property, or both), it could be something else. Start there. See if that corrects the problem.

 

Thank you very much! The issue has been resolved by "enabling all macros". I do appreciate also the instructive comments regarding the bookkeeping application, which I plan to implement.
Congratulations on solving the problem. Continued success with the project.