Multiplying from txtbox values

popeye

Work smarter, not harder.
Local time
Today, 07:55
Joined
Aug 23, 2004
Messages
75
ok 2 problems.

#1.

I have a bound field on my form called "salary" and a combo boox called "multiplier", which is unbound but dispalys two numbers for the user to select 1.

i have a third text box bound named "amount" which should be the result of salary*multiplier.

Salary is stored in a table and a query, multiplier is not stored, and amount is in the same query.
 
Salary is stored in a table and a query,
- ONLY tables store data. Queries create recordsets that show selected data from a table. The recordset is destroyed when the query is closed.

You have three fields - salary, multiplier, and a calculated value. Your intention is to store salary and the calculated value. I would choose to store salary and multiplier and then calculated the extended value in the query. the calculated value in the query will look like:

Select Salary, Multiplier, Salary * Nz(Multiplier,0) As InsuranceAmt
From YourTable;

Using this method, you can base your form on the above query and if someone changes either Multiplier or Salary, the InsuranceAmt will AUTOMATICALLY be recalculated. You won't need any code anywhere to make this all work.

I suggest storing Multiplier rather than the calculated value because it will make more sense if you want to do any analysis based on the distribution of chosen multipliers.
 

Users who are viewing this thread

Back
Top Bottom