PC Review


Reply
Thread Tools Rate Thread

Calculations in Forms

 
 
rciolkosz
Guest
Posts: n/a
 
      5th Jan 2010
Is it possible to add two numbers together in a form field and drop the
result in the table?

 
Reply With Quote
 
 
 
 
Jeff Boyce
Guest
Posts: n/a
 
      5th Jan 2010
Forms display data, tables store data. For that to work, you'd have to tell
Access how to get the calculated value into the table.

HOWEVER!!! It is rarely necessary to store a calculated value in a table.
More often, it is sufficient (and less risky when you think about data
integrity) to use your table to store the components, then use a query (or a
form) to do the calculation on-the-fly.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.


"rciolkosz" <(E-Mail Removed)> wrote in message
news:23384D7D-EE38-4978-A237-(E-Mail Removed)...
> Is it possible to add two numbers together in a form field and drop the
> result in the table?
>



 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      5th Jan 2010
On Tue, 5 Jan 2010 09:28:01 -0800, rciolkosz
<(E-Mail Removed)> wrote:

>Is it possible to add two numbers together in a form field and drop the
>result in the table?


Yes. But DON'T.

Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.

Just redo the calculation whenever you need it, either as a
calculated field in a Query or just as you're now doing it -
in the control source of a Form or a Report textbox.
--

John W. Vinson [MVP]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculations between forms Jamie Microsoft Access Database Table Design 1 18th Jun 2008 02:02 PM
Forms Calculations =?Utf-8?B?U3VuZGFuY2UwMDA=?= Microsoft Access Forms 1 12th Sep 2006 10:06 PM
Forms Calculations Donald Sweat Microsoft Access Forms 2 8th Jun 2005 07:06 PM
Calculations in Forms =?Utf-8?B?Sm9keQ==?= Microsoft Frontpage 8 19th May 2005 01:45 PM
Calculations in forms jason Microsoft Access Forms 5 15th Dec 2003 09:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:49 PM.