Hi I am trying to work out if I can set the default value of a field called "NumDays" to be the difference between the "VisitDate" entered in that record instance and the "VisitDate" entered in a previous record for the same person where that record's field "OriginalStartDate" is True. I'm not sure what to do if there isn't one or if the record being entered is the first record for a person? Alternately, when adding a new record and updating the field "VisitDate" I want this condition to run which I suppose I can do on the Update Event. Anyone know how to do the code for calculating this? In my head so far it should go along the lines of:
Upon Update VisitDate,
if number of records for person is more than 0 then
if date is valid visitdate i.e. Mon-Fri date then NumDays = VisitDate - VisitDate from record where OriginalStartDate Is True
else msg "visitdate not a valid date selection"
Any assistance with correct coding to identify VisitDate from correct record and also how to calculate number of days between dates will be great - it's been years since I worked in Access and with two young babies am rather rusty![]()