I don't use Acces, but I think you need the "BeforClose" event. Hope this helped ya out.
---------------------------------------
This will be the day when all of God’s children will be able to sing with a new meaning, “My country, ‘tis of thee, sweet land of liberty, of thee I sing. Land where my fathers died, land of the pilgrim’s pride, from every mountainside, let freedom ring. - Marten Luther King
Again I don't use Access but for Excel or Word there is a process involving creating a Class module and so on to access application events. There may be something similar for Access.
I think the Excel process is outlined in the FAQ section here. If not there is a description here
To the best of my knowledge there are no Access Application Events. There isn't any kind of code module attached to the application - they only exist in databases.
Also AFAIK there is no Database Close Event either but it is possible to mimic one using the technique outlined by sugarflux - but note that the form load on startup is database startup and NOT application startup.
Enjoy,
Tony
-------------------------------------------------------------------------------------------- We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at [url=http://www.vbaexpress.
There are no application events in Access? But I've used the AutoExec macro to execute VBA code at the start when MS Access loads. So I thought that there should be a macro of some sort that executes VBA code before the application closes.
Start up Access and open/create a new database. Does your code run at any point?
Enjoy,
Tony
-------------------------------------------------------------------------------------------- We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at [url=http://www.vbaexpress.
The Autoexec macro is a special macro which is executed automatically whenever the database is opened. Therefore I juse include the RunCode action within the macro to call my VBA code. As I was saying before, I am looking for something similar except executing before the application closes.
I don't wish to be too pedantic, but you are not using an Application event there. You can use an Autoexec macro or set database startup options to run on Database startup, but not Application startup.
As I said in my first post, I don't think it's directly possible to trap database closing but you might be able to mimic it along the lines suggested by sugarflux.
Enjoy,
Tony
-------------------------------------------------------------------------------------------- We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at [url=http://www.vbaexpress.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.