473,506 Members | 17,000 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

field validation rule for access

1 New Member
i have two fields PROJECT START DATE and PROJECT END DATE.
now i want to creat a validation rule so that the Project End Date will be greater than the Project Start Date.
Can any one please help me out i need this as soon as possible
Apr 30 '07 #1
3 1417
MMcCarthy
14,534 Recognized Expert Moderator MVP
I am moving your question to the Access forum where you are more likely to get help.

Mary
Apr 30 '07 #2
MMcCarthy
14,534 Recognized Expert Moderator MVP
i have two fields PROJECT START DATE and PROJECT END DATE.
now i want to creat a validation rule so that the Project End Date will be greater than the Project Start Date.
Can any one please help me out i need this as soon as possible
In the validation Rule property of [Project End Date] put

Expand|Select|Wrap|Line Numbers
  1. >[Project Start Date]
Apr 30 '07 #3
pks00
280 Recognized Expert Contributor
I prefer the use of vba because u want to validate both start and end dates - thats if both are entered by the user.
Its possible for someone to enter a end date then a start date

eg

Expand|Select|Wrap|Line Numbers
  1.  private sub ProjectStartDate_BeforeUpdate(Cancel as integer)
  2.     Cancel = ValidateDate
  3. end sub
  4.  
  5. private sub ProjectEndDate_BeforeUpdate(Cancel as integer)
  6.     Cancel = ValidateDate
  7. end sub
  8.  
  9. private function ValidateDate as integer
  10.  
  11.     ValidateDate = false
  12.  
  13.     if isnull(Me.projectStartDate) = false and isnull(Me.projectenddate) = false then
  14.         if Me.projectStartDate > Me.projectEndDate then
  15.             msgbox "Invalid date"
  16.             ValidateDate = true
  17.         end if
  18.     end if
  19. end function
  20.  
Apr 30 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2866
by: Jenni | last post by:
Sorry about the unwieldy title, it's difficult to describe it in any other way. Basically I have a table in Access 97 which contains a number of records in different states. When originally...
1
2952
by: Brains | last post by:
hello, I am new to access .I am trying to validate a numeric field (Employee number)This field is not auto generated,it is user input field.The data entered in this field should not be less than...
2
10410
by: Doslil | last post by:
I am trying to validate the fields in my database.I have already validated the fields to check for not null.Here is what I have written for Numeric and text field. Private Function EENUM() On...
2
2674
by: Joey P | last post by:
Hi all, I am doing a project for university whereby i have to implement a simple database related to a frozen foods company. I am having some trouble though creating a validation rule for one...
3
1949
by: Earthling | last post by:
Any help would be appreciated to solve the following simple problem that I will describe. *** There is a form called "red chocolate form". The form has a particular subform field that has a...
0
1169
by: Tom_F | last post by:
To comp.databases.ms-access -- I recently made changes to some field validation rules in a table. When I tried to "Copy" and "Paste Append" some records to the new version of the table, from an...
9
3095
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
10
2923
by: canam | last post by:
Hi: I hope someone can help me. Is there a way to add a password to a particular field in the event that the validation rule must be over written? I've created an input form in a...
10
5684
by: gweasel | last post by:
What is the best way to apply a Validation Rule - or rather, where is the best place to put it? Is there an advantage to putting it on the field in the table vs setting the validation rule on the...
5
7024
by: TechyGal | last post by:
Hi there, I really hope someone can help as I have been trying for two days now and to no avail. I am trying to add a validation rule to a memo type field in MS Access 2007. I need to limit the...
0
7218
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7103
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7307
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4701
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.