calculated date field as default in a bound field

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.
 
W

Wayne Morgan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top