Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 31st, 2007, 08:00 AM
Authorized User
 
Join Date: Jun 2007
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delete all sessions alive before 7am

I am trying to understand if this is possible...

I currently have a table called tblSession. This inputs the User,JobNumber user is currently viewing & DateTime. from this, everytime a User goes into a Job then it populates the table with the JobNumber and when the User goes into another Job it deletes the previous Job Number and replaces it with the next Job Num. What I am wanting to do is that no one would really be in the Database between 8PM & 7AM, I want to try and see if the first person in the database it runs a query and deletes any sessions that are still showing in the table, How is this possible?

Jez



 
Old August 6th, 2007, 04:47 AM
Authorized User
 
Join Date: Jun 2007
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Does anyone have any ideas on this?

 
Old August 6th, 2007, 11:30 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I am not sure why you are tracking sessions this way since no records are being kept. That being said, what I would do is the following:

Create a small table with a single date field in it, called dtDate (PK date field)

When a user opens the app and the main form comes open, on the main form's On Load event, put code to check for today's date in the date table. If today's date is not in the table, run a delete query on the session table, and then PUT TODAY's DATE in the DATE TABLE!

So each user does this check every time they open the database, but only the first person in each day actually runs the delete query.

Did that help? Do you need help with the code?


mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to delete file System.IO.Delete error maricar C# 13 March 14th, 2014 06:50 AM
Radiobutton click keeping session Alive zaheerabbas.sk ASP.NET 1.0 and 1.1 Basics 1 April 5th, 2007 11:36 AM
Mixing classic ASP sessions with ASP.NET sessions scorpion_king General .NET 2 August 4th, 2004 08:20 AM
Keeping data alive eapsokha Classic ASP Databases 4 February 17th, 2004 03:20 AM
Online alive support mccoco Classic ASP Basics 1 September 24th, 2003 02:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.