Making a Field Dependent Upon Another Field

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

Guest

I am currently building a database for my family's publishing business. I have encountered a problem with Access that has put me at a standstill. I need to make one field dependent on another, in this case, the {Fee Charged for Illustrations} needs to be dependent on the {Number of Illustrations}
My formula for doing this in Excel was simple, its $1.00 for every illustration, so therefore I made the fee charged field

{Whatever column the # of illustrations was) * 1.0

I need to do the same thing in access, but everytime I write a macro for doing just that, it doesn't update the field. I have spent a rediculious amount of time trying to execute my formula in the table so any help would be much appreciated!
 
Use the AfterUpdate event of the first text box to update the second. This
can be done in a form, not directly in the table.

Private Sub Number_Of_Illustrations_AfterUpdate()
Me.[Fee Charged for Illustrations] = Me.[Number Of Illustrations]
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Theseus47 said:
I am currently building a database for my family's publishing business. I
have encountered a problem with Access that has put me at a standstill. I
need to make one field dependent on another, in this case, the {Fee Charged
for Illustrations} needs to be dependent on the {Number of Illustrations}.
My formula for doing this in Excel was simple, its $1.00 for every
illustration, so therefore I made the fee charged field:
{Whatever column the # of illustrations was) * 1.00

I need to do the same thing in access, but everytime I write a macro for
doing just that, it doesn't update the field. I have spent a rediculious
amount of time trying to execute my formula in the table so any help would
be much appreciated!
 
I am currently building a database for my family's publishing business. I have encountered a problem with Access that has put me at a standstill. I need to make one field dependent on another, in this case, the {Fee Charged for Illustrations} needs to be dependent on the {Number of Illustrations}.
My formula for doing this in Excel was simple, its $1.00 for every illustration, so therefore I made the fee charged field:

{Whatever column the # of illustrations was) * 1.00

I need to do the same thing in access, but everytime I write a macro for doing just that, it doesn't update the field. I have spent a rediculious amount of time trying to execute my formula in the table so any help would be much appreciated!

Excel is a spreadsheet, a good one. Access is a relational database.
THEY ARE DIFFERENT. Applying spreadsheet logic to a table is a sure
way to get a BAD DESIGN!

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.
 
Back
Top