?
Solved

Writing into the DB before access closes

Posted on 2004-04-30
4
Medium Priority
?
297 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 51

Accepted Solution

by:
Steve Bink earned 320 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 180 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 51

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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

801 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