Need design advice

gmatriix

Registered User.
Local time
Today, 10:25
Joined
Mar 19, 2007
Messages
365
Hello All,

I need some design advice. I have a form that needs some calculations done. My first attempt was to put code in each control that is effected and it worked.

However, I got this bright idea to just write one code and just call the code on a "After Update" event on the effected control. This works but not well at all. It calculates late and I just cannot fix it.

Which is better to do? 1st example or second or maybe something else you can think of?

This type of thing is done very simply in excel (4 x 32 = 128) (I understand that access is not excel)

Example: If I have a field called "Material Cost" ($32.00) and a field called "Fixtures" (4) and I want to multiply the Material cost by the number of Fixtures, in a field call "Fixture Cost" it would equal ($128.00) right?

However, on the form...If I change the 4 to a 6 in the "Fixtures" field and tab or return (in essence after update) the "Fixture Cost" field with immediately change to ($192.00)

What is best way and more efficient way to accomplish this (you would think) easy task or a form?

I would great appreciate your input. Or if you have some examples I can look at that would great!

Thanks
 
The best and efficient way is not to calculate at all.. You have the data at hand.. i.e. Material Cost and Fixtures.. Which is all you need to have, any calculations like the Fixture Cost needs to stay in Queries that are run then and when needed.. Allen Browne talks about Storing Calculated Values in detail.. Look over that.. If you want to display the value in an UNBOUND, control you can do that, using AfterUpdate event of the two controls..
 
Pr2,

You are taking me to school again. This was very helpful. I will try some of these suggestions. Hopefully this will stop me from banging my head.

Thanks again!
 

Users who are viewing this thread

Back
Top Bottom