Need help in creating alerts/reminders for dates (1 Viewer)

jingw

New member
Local time
Today, 16:12
Joined
Jun 20, 2017
Messages
2
Hello, I would like to find out about how I can set up pop up reminders for dates. In my database, I have dates for worker's permit renewal and I would like to establish alerts 30 days prior to these dates. I am fairly new to Microsoft access 2016 and hence I would need help in greater detail. Thank you very much.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 03:12
Joined
Feb 28, 2001
Messages
27,179
OK, the starting point is to realize that you need a foundation on which to build things of an automatic nature. Code doesn't just run. You need to do things to make it run. Popping up a reminder box, for example, requires a place for code to execute to test your pending event dates and to take action in that context. Typically, this is done with a form so that you can have a VBA context in the form's class module.

The next thing to remember is this Old Programmer's Rule #2: Access won't tell you anything you didn't tell it first. So you have to have a table of dates and the events to be associated with those dates, like: Renew permit, get wife flowers, pick up kid from school, whatever...

Depending on what you are doing with this database, there are a couple of possibilities. The SIMPLEST is to have a defined "Opening Form" - a form that will be launched when you launch the database. In that form's OnLoad event, you could put some code to perform your tests against the event table to see if any event has become due. Which implies a loop through a recordset based on a table or query of events and dates to see if the current date is now later than or equal to the indicated event date, and pop up a message box with the text of the event description.

To go farther than this, I would have to start making assumptions about the other parts of your database. But this might give you something to think about and to start looking up in this forum using it's search feature.
 

jingw

New member
Local time
Today, 16:12
Joined
Jun 20, 2017
Messages
2
Hi!! Let's say I have the fields: "WorkerID" and "PermitExpiryDate". Can anyone generate a code which I can apply such that if the PermitExpiryDate is 30days from today, a pop-up message would appear stating 'Permit expiring in 30 days'?
Thank you in advance!!!
 

HiTechCoach

Well-known member
Local time
Today, 03:12
Joined
Mar 6, 2006
Messages
4,357
Here is a working example that you can adapt:

Reminders


Note: At this time it is still in an Acess 2000 database (mdb) to allow a simple example to be used with Access 2000, 20002/2003, 2007, 2010, 2013, and 2016.
 

Users who are viewing this thread

Top Bottom