VBA event on close database

valeryk2000

Registered User.
Local time
Today, 15:54
Joined
Apr 7, 2009
Messages
157
I have Access 2007 front end to SS2K8. I have a local audt table that writes the date/time of user login. When the user closes the db by clicking Exit button the info from this local table is sent to Sql server back end. But ... when the users clicks X button it does not happen. Is there a VBA event that can be used on X-cllick?
Thanks
 
You could create a form which is then opened in hidden view when the DB is opened. You could use the Unload event of the hidden form to write back to your tables. Code in this event should fire however the DB is closed.
 
I see ... so ... THANKS! Let me try it
 
Thanks.
Problems:
There is no Visible property on the form. So I placed on Form_Load me.visible=false does not work
On Unload code works ok.
 
Use code to open the form as a hidden form. Something like:
Code:
    DoCmd.OpenForm "YourFormName, , , , , acHidden
 

Users who are viewing this thread

Back
Top Bottom