Please further elaborate on the your explanation. Sheet: My database which feeds from the Form. The expression i used in the form displays the differences but when saved to my database the field are blank. Hope this clarifies. New in using access so still having difficulty understanding it.
Thanks for the additional info, I am just now looking at this thread again.
As I and others have mentioned, if you want to have a Bound control on a form (where the data is dynamically bound to the Table data - and thus will save when something is typed into it), then you have to adjust that control's ControlSource property to match a column in the form's underlying Recordsource [also a property]. Then when someone types something in there, it gets saved to the table.
On the other hand, when you have (as a control's ControlSource), an
expression, like DateDiff, that will display on the form for display purposes, but be unbound, and not save to the table.
In order to take a moment in time when someone is using the form, and make a calculation (like Date Diff) and then have that save to the table, you will have to write some code. Some ideas are:
- code the form's BeforeUpdate event to cause the control's value to become your DateDiff expression
- code in the source controls' Exit or LostFocus events (those controls whose values are the sources of the DateDiff, might just be one), in order to update the destination control.
I would probably recommend the first one.