Solved

Writing into the DB before access closes

Posted on 2004-04-30
4
289 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 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

737 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