Lembit Soobik
lembit.dbamail at t-online.de
Fri Jun 15 10:27:48 CDT 2007
thanks, John, I wont ask you for your age when you come here to have some beer with me ;) but I think your age calculation is not always correct. depends on whether you calculate before or after the birthday :) Lembit ----- Original Message ----- From: "John Bartow" <john at winhaven.net> To: "'Access Developers discussion and problem solving'" <accessd at databaseadvisors.com> Sent: Friday, June 15, 2007 5:05 PM Subject: Re: [AccessD] Birthday in table > Lembit I just checked my Op.Lic. App to see how it handled Feb 29. It > worked > fine. I put this code in the lost focus event: > > 'check if applicant is 21 or over - display age if not > Dim intAge As Integer > intAge = Year(Now()) - Year(Me.txtBirthdate) > Me.txtAge = "Age: " & intAge > If intAge < 21 Then > Me.txtAge.Visible = True > Else > Me.txtAge.Visible = False > End If > > BTW I don't force the issue if the applicant is under 21 because in some > places they can still serve alchohol even though they can't drink what > they > serve. I just display their age if it's less than 21. > > HTH, > John B. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.472 / Virus Database: 269.8.16/849 - Release Date: 14.06.2007 > 12:44 > >