Topic - Does 'Delete VBA project' kill Macros?

XelaIrodavlas

Registered User.
Local time
Today, 23:27
Joined
Oct 26, 2012
Messages
175
Hi all,

When you get this message, does it delete Macro's as well as the VBA project?

The database cannot be opened because the VBA project contained in it cannot be read. The database can be opened only if the VBA project is first deleted. Deleting the VBA project removes all code from modules, forms and reports. You should back up your database before attempting to open the database and delete the VBA project.
To create a backup copy, click Cancel and then make a backup copy of your database. To open the database and delete the VBA project without creating a backup copy, click OK.

I'd like to setup some kind of prompt/message to trigger if this has happened, but of course I can't use VBA to do it!

Any thoughts appreciated :)

Many thanks,
 
no, it just deletes all the code. All vba code everywhere.
The macros remain.
You dont need to code to prevent this message because THIS message is the warning, and yes, all the code would be gone anyway.

I dont know why this happens, but I still get this from time to time. Its a db corruption most likely. Which is why I backup constantly after I make revisions. You never know when the db will crash and corrupt itself.
Now when it does, I copy,paste, boom, back in business.
 
Thanks Ranman256, I had a feeling that was the case but I was unable to replicate the circumstances to test it.
 
Thanks Ranman256, I had a feeling that was the case but I was unable to replicate the circumstances to test it.

It is hard to replicate how you corrupted the database.

Are you editing the front end database over the LAN (database not on local hard drive)? If yes, network drops can cause corruption while designing. I will only go into design mode on any object when the database is on a local drive. Since I started doing this many years ago I have not seen your issue.
 
Last edited:
Interesting point. In this case I wasn't editing anything, it happened to one of the users but he doesn't know what went wrong it just popped up when he opened the file.

But you're right I shouldn't edit while on the network, and though I'd like to say I've never done it before, I must confess it has happened once or twice... Thank goodness for backups right? :)

Cheers,
 
Interesting point. In this case I wasn't editing anything, it happened to one of the users but he doesn't know what went wrong it just popped up when he opened the file.

AlexSalvadori,

I find it best to only deploy a front end that is compiled (mde/accde) That is why I assume it was you editing the database and not an end user.

Have you tried deploying the front end compiled (accde/mde)?

I don't remember ever having the corrupt VBA issue with a compiled database (mde/accde) on the local drive. I have only seen it with mdb and accdb files, even on the local drive.

I once help a new client that had an untrapped error in a mdb/accde and the end user ended up in the VBA cade. They did something to corrupt the VBA code in database. Another reason to use a compiled front end.

Glad to hear you are making backups! :)
 

Users who are viewing this thread

Back
Top Bottom