Results 1 to 2 of 2
Thread: Successive Dates
2010-03-03, 04:42 #1
- Join Date
- Nov 2001
- Sydney, New South Wales, Australia
- Thanked 0 Times in 0 Posts
I am keying in data into a results table and I need to setup a checking process during the data entry so that each new results record is dated is after, not before or equal to, the date in the previous records. Does anyone know how to set this up? In other words, I need Access to prevent both an earlier date or the same date in any previous records.
2010-03-03, 06:53 #2
- Join Date
- Jun 2002
- Mt Macedon, Victoria, Australia
- Thanked 45 Times in 44 Posts
The Dmax function can be used to determine the maximum value of a field in a table, or in a subset of records from the table.
So you could use this in the Before Update event to check that the date entered is greater than current maximum.
Another option to prevent it happening, rather than catch it after it has, is to be base data entry on a combo box that selects dates greater than DMax. In that case you would need to requery the combo in the OnCurrent event of the form.
Which ever way you do it, you will have problems if you ever need to go back and correct an incorrectly entered date.
I don't think you can do what you want with a table level validation rule.Regards