How to do calculations on 2 table fields to create a new table field?

Bill Bisco

Custom User Title
Local time
Today, 14:07
Joined
Mar 27, 2009
Messages
92
I have 3 fields in a table: Option1, and Option2, and OptionMix.

I want OptionMix = Option1 / Option2.

I cannot use a query for because I want the user to be able to change OptionMix once this initial Calculation is Done.

In other words, Once this Code is Executed, every Record will have the Value of OptionMix equal to the equation above, but after that the OptionMix Value could be manipulated as usual.

If anyone could help, it would be appreciated cause I'm not sure how to do this in VBA :confused:
 
I have 3 fields in a table: Option1, and Option2, and OptionMix.

I want OptionMix = Option1 / Option2.

I cannot use a query for because I want the user to be able to change OptionMix once this initial Calculation is Done.

In other words, Once this Code is Executed, every Record will have the Value of OptionMix equal to the equation above, but after that the OptionMix Value could be manipulated as usual.

If anyone could help, it would be appreciated cause I'm not sure how to do this in VBA :confused:

I assume that this must be a One-Off process, and therefore an Update Query would support your needs. It makes no sense to repeat the process if you are going to want to be able to modify the combined field value.

Are you doing this to prepopulate a new field that you added to an existing table?
 
Yes, I just want to Prepopulate this Field with these Values. If the user wants to change these Values later, I want to let him/her. (there is no harm to the rest of the database by letting them change these values)
 
Yes, I just want to Prepopulate this Field with these Values. If the user wants to change these Values later, I want to let him/her. (there is no harm to the rest of the database by letting them change these values)

Build an Update Query that adds the values from Option1 and Option2, and stores the results in OptionMix. After you run it and verify that it worked properly, you can discard it. Remember to make a backup of the database first as a precaution.
 
Well MSAccessRookie,

That was a ton easier than I thought. Thanks a bunch :)

Sincerely,
Bill
 

Users who are viewing this thread

Back
Top Bottom