set an alarm

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

Guest

Hi, just started Access and need to find out how to make a date field alarm
when it has gone past it's date. Can anyone help please. I'm pretty basic
so go easy please.
 
Trojan,

I guess a key decision here is to identify an appropriate event to get
your "alarm" triggered. Maybe it would be the Open event of a form
which always opens whenever you start the database. Anyway, whatever
the event, you can write a VBA procedure which tests the date against
the current date. Is the date field in question in a table where it is
the only record? If not, how do you know which record to refer to?
Anyway, something like this may be applicable...
If DLookup("[YourDate]","YourTable") < Date Then
MsgBox "Ding Dong", vbExclamation, "Date exceeded"
End If

Please post back with more details if this kind of idea doesn't fit the
bill.
 
Sorry for not giving you enough information Steve and thanks for your help.
I've set up a dbase with a list of peoples names and addresses and three of
the fields are dates. What I'm trying to do is to get the dbase to flag up
the persons name each time a date field passes Now(). Hope this is more
helpful Steve, if not please get back.

Steve Schapel said:
Trojan,

I guess a key decision here is to identify an appropriate event to get
your "alarm" triggered. Maybe it would be the Open event of a form
which always opens whenever you start the database. Anyway, whatever
the event, you can write a VBA procedure which tests the date against
the current date. Is the date field in question in a table where it is
the only record? If not, how do you know which record to refer to?
Anyway, something like this may be applicable...
If DLookup("[YourDate]","YourTable") < Date Then
MsgBox "Ding Dong", vbExclamation, "Date exceeded"
End If

Please post back with more details if this kind of idea doesn't fit the
bill.

--
Steve Schapel, Microsoft Access MVP

Hi, just started Access and need to find out how to make a date field alarm
when it has gone past it's date. Can anyone help please. I'm pretty basic
so go easy please.
 
Trojan,

If you made a query based on your table, with a criteria of...
<Date()
.... in each of the three date fields (with OR for the criteria), would
this give the results you are after? If not, maybe you could post back
with some examples to illustrate what you mean.
 
Thanks Steve, that sorts out my problem nicely and the nice part about it is
that the queery shows the date, just to be awkward is there a way of making
it alarm me when it changes or do I have to run the queery?
 
Trojan,

The "alarm" would need to be in response to an "Event" within the
database. For example, the Open event of a form that is always opened
whenever the database starts up. Or the Click event of a command
button. Or the Timer event of a form. You would need to decide what is
the applicable time(s) when you want this checking to be done. Then,
you can write a procedure that alarms you if there are any such dates,
for example...
If DCount("*","YourQuery")>0 Then
MsgBox "Persons in database with expired dates"
End If
or...
If DCount("*","YourQuery")>0 Then
DoCmd.OpenForm "ExpiredDates"
End If
(where ExpiredDates is a form that shows the person(s) with expired dates)

Or, if you just want those that have expired since the last time you
checked, or those that have expired in the last 24 hours, or whatever,
then this is all possible too.
 
Thanks Steve, your a genious, thats saved me an awful lot of headaches. This
has been my first time in a discussion group and it's been an eye opener.
Cheeeers.
 
Trojan,

I am happy to know that we have made progress. Best wishes for the rest
of your project.
 

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