Solved

Writing into the DB before access closes

Posted on 2004-04-30
4
286 Views
Last Modified: 2006-11-17
Hi All,

Help me figure this out please?
I've created a system which writes in the userID and the time when the user logs in. I've also created a logout button which will add the logout time to the same record.
But, the user can choose NOT to click the logout and instead close the entire access.
Now, I have 2 solutions:

1. Detect when access is going to close, write the logout time to the table before closing. The thing is, i don't know how to do that. The detecting part that is...

2. Disable the close buttong (the X button on the top right hand corner) of access.

I'll accept any other solutions if it works too. 8-p

Xhenkaii
0
Comment
Question by:xhenkaii
  • 2
4 Comments
 
LVL 50

Accepted Solution

by:
Steve Bink earned 80 total points
ID: 10962047
Make a form that will be open the entire time the user has Access open.  You can make it invisible, even, to make sure your users don't mess with it.  Use the OnUnload event or OnClose event from that form to do what you need to do.
0
 
LVL 11

Assisted Solution

by:Mighty_Silly
Mighty_Silly earned 45 total points
ID: 10962153
Hi X,

Just wanna say that I agree with Routinet that you can use the form's UnLoad Event to capture EXIT and updates the table with your existing codes.

Let's say you have a Switchboard that is ALWAYS Loaded (either Visible or Not Visible), then on its UnLoad event, call the Logout procedure you have.


-Silly-
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 10962266
Switchboard is a good call, and is my object of choice.  I've had a couple problem users who decided they didn't need the switchboard and kept closing it in favor of using the db window.  I fixed that by attaching code to close the db when the switchboard closes.  :)
0
 

Author Comment

by:xhenkaii
ID: 10970738
Works great!! Thanks!
I've split the pts becus i used the idea of hiding the values i needed on the switchboard and writing them on the table when the switchboard unloads.

Xhenkaii
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Set a default value to Null 1 19
Count of values in access 2 27
Undo Button 1 31
ASP Classic Query that needs to display more information 18 30
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question