Missing Macro Code

User avatar
omega0401
StarLounger
Posts: 84
Joined: 13 Mar 2010, 18:17

Missing Macro Code

Post by omega0401 »

I'm running Access 2013. I opened my database today and got a message that it couldn't find my function that runs in my autoexec. I opened this database about a month ago with no problem. I checked the trusted settings and the macro setting says to disable all macros with notifications. I didn't get any notifications so I set it to enable all macros. Then closed and reopened the database and got the same message. Then I discover I have a global module with no code in it and all the code in my forms are missing. That would be the reason I didn't get any notifications. But, what happened to all of my code? Is it possible my IT department is running some kind of security software on my PC to delete or hide code? I can't think of anything else to cause this.

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Missing Macro Code

Post by HansV »

I suspect that your database has somehow become corrupt. Do you have backups? If so, you could inspect them to see if you can find a version with the code intact. You could then import or copy the code into the current version (or copy the current data tables into the backup copy).
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Missing Macro Code

Post by Rudi »

I could be wrong, but I can recall reading up on something late last year where someone said that there was a known bug that caused this to happen when doing a backup through the Backstage and that its best to backup a DB via Explorer. Whether that is true or not, I dunno?
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
omega0401
StarLounger
Posts: 84
Joined: 13 Mar 2010, 18:17

Re: Missing Macro Code

Post by omega0401 »

Fortunately for me I do have a backup and it has all my code. What a relief. The scary part is what if I had backed up my current, bad database and deleted my good backup. I would have been in a lot of trouble if I couldn't restore the deleted one. I was only keeping one backup at a time but no more. I'll store multiple backups for now on. I do use Explorer for doing backups.