A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

VALIDATION RULE



 
 
Thread Tools Display Modes
  #1  
Old May 6th, 2010, 11:11 PM posted to microsoft.public.access.forms
JOSELUIS via AccessMonster.com
external usenet poster
 
Posts: 26
Default VALIDATION RULE

Hello everybody! I´m trying to create a BirthDate textbox in my frmContacts
(Jeff Conrad & Viescas) with the following code:

Private Sub BirthDate_BeforeUpdate(Cancel As Integer)
' Make sure date not in the future
If Me.BirthDate Date - (365 * 18) Then
MsgBox "Contact must be older than 18.", vbCritical, gstrAppTitle
Cancel = True
End If
End Sub
But only woks if I select to Show the data picker and I pick the date from it.

I also tried this one:
Validation rule:= (Date()-(365*18))
Validation Text:Contact must be older than 18
But it works neither the Calendar Activex Control frmCalendarOCX nor
frmCalendar however it works with the data picker.Providing I use in most of
my data fields frmCalendar because it is easier for me to select a date than
from the data picker, can I solve this problem easily without using the data
picker? Maybe because I´m using the following date format: dd/mm/yyyy and the
spanish version isn´t working properly.

--
Message posted via http://www.accessmonster.com

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:41 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.