[AccessD] data validation

jwcolby jwcolby at colbyconsulting.com
Thu Apr 7 21:46:37 CDT 2011


Scenario:

I fill out a pass request = date / time from / time to.
The pass request's time from needs to be < the Time to.

Three detail records - location / time from / time to.

The detail record's time from needs to be >= the pass request time from and <= the pass request time 
time to.

Any subsequent detail record needs to follow the same rules but also needs to be after the first 
request's time from / to.

Any change to any time needs to re-perform the validation.

Pass request:

5/1/2011 08:45 - 13:00

Detail record:

Church 09:00 - 11:00
Restaurant 11:00-12:00
park 12:00-12:45

There must always be a pass request date / time
There must always be one or more detail records.
There may be up to three detail records.

How would you perform data validation in this scenario?

I vote for a pair of classes - time class and supervisor which is the pass time and has code to 
check the details against itself, with a collection to hold the time classes.  Time classes have 
code to compare itself against another time class.

Etc.

I have never had to do a validation like this but now I need to.

-- 
John W. Colby
www.ColbyConsulting.com



More information about the AccessD mailing list