Data Entry Cutoff

  • Thread starter Thread starter Kevin C.
  • Start date Start date
K

Kevin C.

Hi-
I have a database where users key in information into a
form. The user are supposed to have all of their data
entered by 9:00 am every morning because at that time I
pull their numbers. The problem is that the users are
still entering information after 9:00 and it is throwing
off our numbers.

Is there any way to program Access to know when it is
9:00am and to prompt the user that they need to key any
new information in for the next day?
 
Use the Timer property on the data entry form. I believe
the property uses milliseconds so set it for 60000 (one
minute). Then, in the OnTimer event, check the current
time and if it's after 9:00:00 AM do what you like. I'd
program it to submit then and there and datestamp any
additional data entered for the next day.

Hope this helps!

Howard Brody
 
Sure. The form level BeforeUpdate event fires when the user tries to save a
new or updated record. If you set Cancel = true in that event, the save will
not be allowed to proceed. So put a check in that event, using the Now()
function, comparing to 9:00 am, and cancel the update if it is after that
time.

If you were only concerned with stopping them entering new records (not
editing existing ones), you could move the check to the BeforeInsert event.
Then, they'd be stopped as soon as they tries to type a keystroke into the
new record. With BeforeUpdate, they can type the whole new record, it just
won't let them save it.

If you use BeforeUpdate, include a Me.Undo to >discard< their changes
authomatically. (The Cancel=True stops the changes saving, but does not
discard them).

More information is available in online help, about evenything mentioned
above.

HTH,
TC
 
Set up a timer to run on a form that is always open. It can be a
hidden form if you like.
When the timer Event fires use it to check the Time and compare it to
your cutoff time Set the Timer value of any non zero value. i would
suggest a big number or the mdb will spend all its time checking the
time & your users will never get any work done
A value of 1000 means run every second

Sub OnTimer ()
dim dtmCritical as date
dtmCritical = cDate("09:00:00")
if dtmCritical < Time() then
'Stop the timer so the message doesn't keep repeating
me.Timer = 0
msgBox "CutOff time has past." 'warn the Users
endif

Be warned that a running timer will make it almost impossible to write
code. as it will force a syntax check every time the timer triggers.

You can even close the database if you want.
docmd.quit
I have used this in the past to shut down idle systems

Regards Greg Kraushaar
Wentworth Falls Australia
(Do not email - the reply address is a Spam spoofer)
(If you really must, remove all UCase and numbers)
 
Back
Top