Link to home
Start Free TrialLog in
Avatar of Svgmassive
Svgmassive

asked on

Save Modules in ms access

Is there a way to save all changes to he modules via a command button etc. in ms access.
Avatar of Daniel Pineault
Daniel Pineault

What about
DoCmd.Save

Open in new window

Doesn't that only work on the active object? Not that I have a better solution. That said, Ctrl-S should save the entire database and all modules.

Doesn't that only work on the active object?
When I tested, it appeared to save everything.


Hey Anders, since you're here, any clue what
DoCmd.RunCommand acCmdSaveAllModules

Open in new window

does?  I've tried using it thinking it would be perfect for this, yet I can't get it to work?!

Strangely, the following works
DoCmd.RunCommand acCmdCompileAndSaveAllModules

Open in new window

So compiling seems required?  I'm confused.

I suppose its possible that Docmd.Save works in the same way as hitting save, i.e. saving ALL active objects and not just the Active object. I really haven't looked into it.


And sorry, this is the first time I've heard of  acCmdSaveAllModules or acCmdCompileAndSaveAllModules

A better question is: Why do you need a button save changes to Modules? A button would show on a Form, and if you're viewing a Form in Form view, you shouldn't be editing a module.



If youre looking for a quick way to save all the changes you've made in the code, afraid you're looking at the wrong way, because:
- It will require executing something, so your code "for saving" will have to compile and be bug-free first, wich defeat the purpose of the desired functionality.
- Ctrl-S shortcut is much faster.
- As a developper, Ctrl-S should be a reflex.
ASKER CERTIFIED SOLUTION
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial