Date "Difference" function? WHAT?????
Can this be done?
I have information about a customer (name, address, DOB etc) which i store in an array
Evertime time i save the customer details, i need something to tell me if the person is over 21 years of age...............is there any way to do this.
I have done everything on my project..............EXCEPT this.
I have looked at all the sources i an find...but to no avail.
Do i use something like Date difference or something , please help.
I have come so far only to fail at this hurdle................aaggggghh!
Thanks
Hi, here is the solution for a Agecheck!
Excuse my sloopy way to write it, but I am lazy.
txtBirthday = the Birthday of the person
21 is in this example the Year to check
It works exactly on the day!
Private Sub Command2_Click()
MsgBox CheckAgeInYears(CDate(txtBirthday), 21)
End Sub
Private Function CheckAgeInYears(datDate, numCheckAge)
datCompareDate = Format(DateAdd("yyyy", numCheckAge, datDate), "dd.mm.yyyy")
MsgBox datCompareDate
If Format(datCompareDate, "yyyymmdd") > Format(Date, "yyyymmdd") Then
CheckAgeInYears = "Not Ok"
Else
CheckAgeInYears = "Ok"
End If
End Function
nice greetings
Franky