Alert age

Tini

New member
Local time
Today, 09:15
Joined
Apr 23, 2011
Messages
8
how to do an alert in microsoft access that inform user when age is >21 year old ?:confused:

I have a parent table and child table, i also create a form that the main form is parent table and it's subform is child tables.
What i want to know here is how to make an alert in form by change the child name color to red when their age >21
Thank you.... ASAP
 
Last edited:
Tini:

First you have to be able to calculate the age. The formula I use is: Int((Date()-[DOB])/365.25).

Next, you can put in the OnCurrent method of the form something like:

If Int((Date()-[DOB])/365.25) > 21
then DOB.Forecolor = 255
Else
DOB.Forecolor = 0 (or whatever color you want)
End if

If you're using continuous forms, then you would want to use conditional formatting.

SHADOW
 
Thank you very much you have save my life..... love you:D
 
i have a table that have name, DOB and relationship. What about if want the alert age only for son and daughter relationship ????
thank
 

Users who are viewing this thread

Back
Top Bottom