Help for a dummy

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Thanx for the help I received. Helped me a lot.

Now I have a second problem. On my one form I have 5 fields.
EmployerRiskFactor, LocalityRiskFactor, DriverRiskFactor, CarTypeRiskFactor
and CompositeRiskFactor. The first four get their values from choices that
the user make in four dropdowns on the form. The last one get its value by
multiplying the values of the first four.

All I did was to type the following in the last textbox
=[EmployerRiskFactor]*[DriverRiskFactor]*[CarTypeRiskFactor]*[LocalityRiskFactor]

It worked very good. My only concern now is to get this textbox to write its
calculated value to the field in the table.

Peet
 
Peet,

The short answer is, you don't. Calculate it on-the-fly when you need it by
creating a query with a calculated field set to the same expression, because:

1. You would need code to write the value to a table. If the table data is
ever changed outside the context of the form where the code resides, the
calculated value would be incorrect.

2. It's faster to calculate it than read it from disk.

Sprinks
 
it is seldom a good idea to save a calculated field in a table. just
recalulate it whenever you want to use/display the value
 
Hi, you guys are great. This is by far the most usefull website I've come
accross. Thanx guys.
Peet

Sprinks said:
Peet,

The short answer is, you don't. Calculate it on-the-fly when you need it by
creating a query with a calculated field set to the same expression, because:

1. You would need code to write the value to a table. If the table data is
ever changed outside the context of the form where the code resides, the
calculated value would be incorrect.

2. It's faster to calculate it than read it from disk.

Sprinks

Peet said:
Thanx for the help I received. Helped me a lot.

Now I have a second problem. On my one form I have 5 fields.
EmployerRiskFactor, LocalityRiskFactor, DriverRiskFactor, CarTypeRiskFactor
and CompositeRiskFactor. The first four get their values from choices that
the user make in four dropdowns on the form. The last one get its value by
multiplying the values of the first four.

All I did was to type the following in the last textbox
=[EmployerRiskFactor]*[DriverRiskFactor]*[CarTypeRiskFactor]*[LocalityRiskFactor]

It worked very good. My only concern now is to get this textbox to write its
calculated value to the field in the table.

Peet
 
Back
Top