time dependant fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello
i'm designing a database on access 2003 where some fields are required for
entry every 15 minutes. is ther a way where a new recored is only allowed to
be generated every 15 minutes rather when you pres enter



thank you
 
Hello
i'm designing a database on access 2003 where some fields are required for
entry every 15 minutes. is ther a way where a new recored is only allowed to
be generated every 15 minutes rather when you pres enter



thank you

There are at least two general ways one could do this. Both would take
some VBA coding, and I'm just thinking out loud here.

1. You could use the timer event of the form. Reset it to 15 minutes
every time a record is added, and set a module level variable (say
mbAllowNewRecord) to False. When the timer fires, set mbAllowNewRecord
to True. In the code for new record, stop the user if mbAllowNewRecord
is False. If you use this method, you'll need to figure out what to do
if the user just closes and reopens the form or application. Make them
wait 15 minutes?

2. You can created date/time field in the record; just set the Default
for that field to Now(). Before you allow a new record, find the latest
create date/time in your table and use date/time math functions to
ensure that at least 15 minutes has passed. This method is trickier if
the application is multi-user - what happens if someone else is also
adding records?

Hope this helps get you started.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top