PC Review


Reply
Thread Tools Rate Thread

Age Limit Validation Rule

 
 
normanlives8
Guest
Posts: n/a
 
      31st Oct 2008
We are trying to limit the age when imputting the data on forms.
We have the customers DOB in format (dd/mm/yyyy)and are trying to limit the
age to 18.
Are there any validation rules to help us achieve this...?
 
Reply With Quote
 
 
 
 
Ken Snell \(MVP\)
Guest
Posts: n/a
 
      31st Oct 2008
You can use a table-level validation rule for this.

Open the table in Design view, click on Properties icon on toolbar, and
enter this expression in the Validation Rule box:

DateDiff("yyyy",[mydate],Date())+(Format("Date","mmdd")<Format([mydate],"mmdd"))>=18

Close the Properties window and save the table.
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


"normanlives8" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> We are trying to limit the age when imputting the data on forms.
> We have the customers DOB in format (dd/mm/yyyy)and are trying to limit
> the
> age to 18.
> Are there any validation rules to help us achieve this...?



 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      31st Oct 2008
Why not just compare the date being input to DateAdd("yyyy", -18, Date())?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Ken Snell (MVP)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You can use a table-level validation rule for this.
>
> Open the table in Design view, click on Properties icon on toolbar, and
> enter this expression in the Validation Rule box:
>
> DateDiff("yyyy",[mydate],Date())+(Format("Date","mmdd")<Format([mydate],"mmdd"))>=18
>
> Close the Properties window and save the table.
> --
>
> Ken Snell
> <MS ACCESS MVP>
> http://www.accessmvp.com/KDSnell/
>
>
> "normanlives8" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> We are trying to limit the age when imputting the data on forms.
>> We have the customers DOB in format (dd/mm/yyyy)and are trying to limit
>> the
>> age to 18.
>> Are there any validation rules to help us achieve this...?

>
>



 
Reply With Quote
 
Ken Snell \(MVP\)
Guest
Posts: n/a
 
      1st Nov 2008
That would work as well.
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_gmail.com> wrote in message
news:%(E-Mail Removed)...
> Why not just compare the date being input to DateAdd("yyyy", -18, Date())?




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Allow enty of data outside validation rule without removing rule =?Utf-8?B?dGFzaA==?= Microsoft Access 2 7th Nov 2007 05:56 PM
age of empires 2 the age of kings =?Utf-8?B?YnViYmE=?= Windows XP Games 1 13th Mar 2004 07:14 PM
Age Validation Rule Anna Microsoft Access Database Table Design 3 4th Feb 2004 05:11 AM
Age of Empires II: Age of Kings Danny W Windows XP General 1 23rd Nov 2003 09:32 AM
Age Of Empires: The Age Of Kings Josh Windows XP Games 2 23rd Oct 2003 07:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:40 PM.