Data Entry Form

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

Guest

I want to use the data entered in a particular field as part of a calculation
and then display the result in a second field on the form, both fields then
being stored in the associated table.
What is the simplest way of coding the form.
Thanks
 
I want to use the data entered in a particular field as part of a calculation
and then display the result in a second field on the form, both fields then
being stored in the associated table.

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.

Since we have no way to know anything about the structure of your data or the
calculation that you're proposing to do, it's more than a bit difficult to
suggest how to do the calculation.

John W. Vinson [MVP]
 
--
Dave Hawks


John W. Vinson said:
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.

Since we have no way to know anything about the structure of your data or the
calculation that you're proposing to do, it's more than a bit difficult to
suggest how to do the calculation.

John W. Vinson [MVP]
The data being entered is a players score on a particular hole, and then using other static data from a seperate table such as the stroke index of the hole and the players handicap I need to calculate the number of points scored and then store both the actual score and the points in the table.
e.g
GS (gross score)=4
Par =4
Hcp =10
SI (Strokeindex )=9
Shots recieved = Iif(Hcp>=SI,1,0)
Result =1
Points =
Iif(GS-Shotsrecieved-Par=-2,4,Iif(GS-Shotsrecieved-Par=-1,3,Iif(GS-Shotsrecieved-Par=0,2,Iif(GS-Shotsrecieved-Par=1,1,0))))
The result = 3 (points )would be displayed below the entered score and both
values stored in the table.
Thanks
 
Back
Top