calculated date field as default in a bound field

  • Thread starter Thread starter Deb
  • Start date Start date
D

Deb

I want an Access db to calculate dates. All dates,
except Day1, are calculated from the preceding date but
any date after Day1 may be changed, and each following
date needs to change accordingly. It is therefore
necessary that there is a default calculated date that can
also be key entered, and when key entered, all the
following dates should change to 14 days later than the
preceding date.
 
Set the Default Value of the control on the form to

DMax("[DateFieldName]","YourTableName")+14

This will find the latest date in the field and add 14 to it to make the
default date. Since this is just a default and not a control source, the
user can change it. If the dates aren't sequential, this may not be the date
that was in the field for the previous (last) record entered. If that is
what you need, then in the AfterUpdate event of the control, set the
DefaultValue of the control to the control's current value.
 
Back
Top