Recording calculated fields in form on parent table

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

Marshall Barton

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

Jonathan Smith

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!
 

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