event timer for a birthday

M

munchkin

I have a field called DOB that I keep track of family and friends birthdays.
I would like to have a popup form that appears within a certain number of
days (doesn't matter) when I open the database or could even be the listbox I
use to display from a query: For example the pop up would comment "John Doe
Birthday is in # days"
 
K

KARL DEWEY

In your Autoexec macro have it open a form that uses a query as record source.

Use this in anniversary query --

Anniversary: DateSerial(DatePart("yyyy",Date()),Right("0" &
DatePart("m",[BIRTHDAY]),2),DatePart("d",[BIRTHDAY]))

Use this for criteria --
=Date()-5

OR put a field in your table for how far in advance to notify - sending card
5 days - planning party 2 weeks - phone call 2 days.
 
J

Jeff Conrad

J

John Vinson

I have a field called DOB that I keep track of family and friends birthdays.
I would like to have a popup form that appears within a certain number of
days (doesn't matter) when I open the database or could even be the listbox I
use to display from a query: For example the pop up would comment "John Doe
Birthday is in # days"

You can do this if your database has a default startup form (or a form
that routinely gets opened by the user such as a switchboard).

Create a Query, qryBirthdays:

SELECT FirstName, LastName, DateSerial(Year(Date()), Month([DOB]),
Day([DOB])) As Birthday FROM yourtable
WHERE DateSerial(Year(Date()), Month([DOB]), Day([DOB])) BETWEEN
Date() AND DateAdd("d", 7, Date());

Maybe create a small form, frmBirthdays, based on this query to show
all birthdays in the upcoming week.

In the automatically opened Form's Open event put code like

Private Sub Form_Open(Cancel as Integer)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("qryBirthdays", dbOpenDynaset)
If rs.RecordCount > 0 Then
DoCmd.OpenForm "frmBirthdays", WindowMode:=acDialog
End If
End Sub


John W. Vinson[MVP]
 
Top