Solved

Writing into the DB before access closes

Posted on 2004-04-30
4
278 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now