Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Posts
    7

    Arrow Unanswered: Save precalculated field

    I need help to save in a field called "Severity" the calculation of a value using a group of others fields, there exist in the same table and all the fields are numbers. I have to use a query or I can use another method more simple just in the form or in the field definition?

    Thanks in advance

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by buzy
    I need help to save in a field called "Severity" the calculation of a value using a group of others fields, there exist in the same table and all the fields are numbers. I have to use a query or I can use another method more simple just in the form or in the field definition?

    Thanks in advance
    SQLString="UPDATE SomeTable SET Severity=FieldA * FieldB/FieldC+FieldD-FieldE WHERE ( Some condition applies ...);"
    DoCmd.RunSQL SQLString

  3. #3
    Join Date
    Feb 2004
    Posts
    7

    More accurate

    Is it possible to create a precalculated field in the table in any form, using a macro or something like that? Due to the design of the form and the fields should be better another solution than the directly SQL statment using an UPDATE.

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by buzy
    Is it possible to create a precalculated field in the table in any form, using a macro or something like that? Due to the design of the form and the fields should be better another solution than the directly SQL statment using an UPDATE.
    What do you mean? Have a formula as part of the data structure itsself? That can't happen ...You have to do some kind of UPDATE whether as a query (via a macro or otherwise ...) or as a discrete SQL statement (like what I did ...)

  5. #5
    Join Date
    Feb 2004
    Posts
    7

    re

    The problem is that I have two index that determine the register to update in the severity, one is the current register showed in the form and the other one is the product Id, selected by a list of products, also the current Severity calculated for this product and other fields that affects the calculated must appear in this list, product, maket affected, Severity, etc...

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •