View Full Version : Looking for Validation help


Jerry Jones
09-05-2001, 11:05 AM
I am still hoping for some help on my validation problem.

The senerio is that on the subform of the main form the data input person selects a code in the first field ( which represents the status of the delivery ie: X3 which stands for Arrival for Pickup) we then tab to the next field which is a date field to record the date of this status code.

When we go to the next record and apply the next status code ie: CP (which stands for Pickup Complete) and tab to the date field we want to insure that the date entered is greater than the previous date of that subform.

I hope this is clear and I thank you in advance for any help you can give.

JerryJ

Laocon
09-05-2001, 12:20 PM
Heheheh... I have posted a few times today suggesting answers all prefixed with "Im new to Access so this might not be the best way...." - please remember that when reading this answer... hehehh...

Anyways, can you use some kind of lookup to find the original value... then display this in a hidden invisble text box on the form (eg the user cant see it or edit it).
Then make a new Control text box that has a default value of the [hidden box]+1. Specify in the control's validation that the value the user enters must be greater than that of the hidden box.

There is probably a much easier way to do this... and if there is Id like to know too http://www.access-programmers.co.uk/ubb/smile.gif

Rich
09-05-2001, 01:01 PM
Look up the DMax function.
Use the before update event to check that the date is greater than DMax your date field.
HTH

Jerry Jones
09-06-2001, 04:51 AM
Thank You for the response.

Could you help me with the coding for this dmax function as I can't seem to get it right. Keep in mind that this is a date field.

Thanks Again

JerryJ