Recording calculated fields in form on parent table

  • Thread starter Thread starter Mick Humphreys
  • Start date Start date
M

Mick Humphreys

Is it possible to record the result of a calculated field
in a form on its parent table (or query) so that I can
then view the result in the table and then construct a
report?
If so how do I do it.
 
Mick said:
Is it possible to record the result of a calculated field
in a form on its parent table (or query) so that I can
then view the result in the table and then construct a
report?
If so how do I do it.

Don't do it. Relational database rules do not allow for
storing values that can be (re)calculated as needed.

In general you should not allow users to see a table in
datasheet view, instead you should always use a form or a
report to view data. If the table is used as the record
source for a report, the report can more efficiently and
more safely (re)calculate the value.

If you have some very special requirements or if I've
misunderstood the question, post back with more details
about the calculation, the report and why you need to do
this.
 
Is it possible to record the result of a calculated field
in a form on its parent table (or query) so that I can
then view the result in the table and then construct a
report?
If so how do I do it.

Definitely possible, although not always a wise decision.

1. Create a FIELD in the Table to store the calculation.
2. Place the FIELD on a Form.
3. Use CODE BUILDER to make the calcuation.

For Example:

User will Input Start Date
End Date will be 10 days from Start Date

Table:
StrtDate
EndDate

Form:
txtStrtDate
txtEndDate

Code Builder
In the After_Update Event of txtStrtDate
Me![txtEndDate]=[txtStrtDate]+10

Good Luck!
 
Back
Top