PC Review


Reply
Thread Tools Rate Thread

Delete a table at certain time

 
 
=?Utf-8?B?SmV6?=
Guest
Posts: n/a
 
      2nd Aug 2007
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?

 
Reply With Quote
 
 
 
 
Stefan Hoffmann
Guest
Posts: n/a
 
      2nd Aug 2007
hi Jez,

Jez wrote:
> 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?

You need a hidden form with a form timer.


mfG
--> stefan <--
 
Reply With Quote
 
=?Utf-8?B?SmV6?=
Guest
Posts: n/a
 
      2nd Aug 2007
Thanks for answering me.

How would I do this, I dont quite understand what you mean with having a
form and a timer, what would be on this form?



"Stefan Hoffmann" wrote:

> hi Jez,
>
> Jez wrote:
> > 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?

> You need a hidden form with a form timer.
>
>
> mfG
> --> stefan <--
>

 
Reply With Quote
 
Stefan Hoffmann
Guest
Posts: n/a
 
      2nd Aug 2007
hi Jez,

Jez wrote:
> How would I do this, I dont quite understand what you mean with having a
> form and a timer, what would be on this form?

Take a look at the event page of the property editor.

The form has a OnTimer event, which is fired according to the value in
TimerInterval.

In this event you can run code like

Dim db As DAO.Database
Set db = CurrentDb
db.Execute "DELETE FROM [Table] WHERE.."


mfG
--> stefan <--
 
Reply With Quote
 
John Spencer
Guest
Posts: n/a
 
      2nd Aug 2007
I would think that you could check the table and see if there were any
records for the current date or later. If not, delete all the records in
the table.
Something like the following

If DCount("*","SomeTable","DateTime>= Date()") = 0 THEN
Currentdb().Execute ("DELETE * FROM SomeTable")
End IF

That code could be executed whenever someone launches the database, so you
would not have to do something complex to determine if they were the FIRST
one on that date to open the database.


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Jez" <(E-Mail Removed)> wrote in message
news:6BA3030F-6187-47DE-977B-(E-Mail Removed)...
>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?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I can onlt delete one message at a time- will not empty my delete Sally Windows Vista Mail 1 25th Apr 2010 06:32 PM
Run Time error 3086 - Can't delete a table using query BlueWolvering Microsoft Access Queries 2 5th Mar 2008 02:27 PM
Delete query unable to delete records from table. Fix how? =?Utf-8?B?TG9uZ1RvbQ==?= Microsoft Access Queries 8 15th Apr 2007 12:29 PM
Run Time error 3156 ODBC Delete on a linked table TABLENAME failed =?Utf-8?B?SG9sbHk=?= Microsoft Access Forms 0 24th May 2006 06:03 PM
HOW DO I DELETE A RECORD FROM TABLE AND IN THE SAME TIME PUT HIM . =?Utf-8?B?S2FpcyBTaGVldA==?= Microsoft Access 1 21st Nov 2004 08:35 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:12 AM.