Time Cutoff

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

Kevin C.

Hi-

I have a form where user enter information into
continuously throughout the day. I would like to set
this form to not accept any more entries for the prior
day after 9:00 am. For example: Today is 3/31. Users
can enter data with the date of 3/30 today up until 9am.
After 9am they need to start using 3/31 as the record
date.

Is there any way to have Access do this?
 
At what point do you want to make this check? The check could be done when
the user enters the date or it could be done when they are finished with the
record and try to save it. Also, do you want a new record to Default to the
dates you specified? It would be possible to not even have the user enter
the date, but have Access do it as the record is saved.

To do any of these as the record is saved, you would use the BeforeUpdate
event of the form. To do this as the user types in the date, you would use
the AfterUpdate event of the date textbox. To simply set the Default Value
of the textbox you could use something like:

=IIf(Time()>=#09:00:00#, Date(), Date()-1)
 
Back
Top