Unique objects for Continuous forms

  • Thread starter Thread starter Nic
  • Start date Start date
N

Nic

Here is the scenario:
I have 2 fields in a continuous sub form, Percentage and calc_dollars
The percentage is bound to the underlying table. while calc_dollars looks
at the "txtTotal" field in the parent form and multiplies by the percentage
to get a dollar amount.

I would like the user to be able to adjust the calc_dollars and then the
percentage is automatically changed, or the percentage box and the
calc_dollars is automatically changed.

First I tried making 2 procedures: Calculate_dollars, and
Calculate_percentage, and having no control source for calc_dollars.
Calculate_dollars is called on the Load event of the sub form to populate
the calc_dollars box with the appropriate values. And then
Calculate_dollars and Calculate_percentage is tied to the After Update event
to the percentage box and calc_dollars box (respectivly).

Problem with this is the calc_dollars is the same in every instance of the
continuous form. For example:

Total = $100
------------------
Case1 : 40% : $60
Case2 : 60% : $60

see the problem : ^ \
I need each instance value to be a unique object.

So then I tried just setting the control source of calc_dollars to
"=percentage.value*Forms!Main_Form!txtTotal.value"

That worked initially, but now it won't let me change the value in the
calc_dollars because it is an expression.

now what??

Thanks for at least reading this!
-Nic
 
Bruce Loving said:
move Calc_Dollars to the subform Current event

Bruce,

any unbound control in a continuous form will display the very same (=
last assigned) value in all records. The only solution to display the
appropriate value for each individual record is to set the
ControlSource to an expression.

Besides, Current does not help if the _current_ record is modified.

Best regards
Emilia

Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de
 
Thanks for the replies.
Either solution doesn't seem to be what I want though. Thanks again however
for taking your time to help me brainstorm about it.

I think I'll just make an extra field in my datatable called
actual_dollars...this field will be calculated everytime an entry is brought
in the Main_Form, so it is kinda extra saved data...but having it bound to a
data column will give me more flexability

-Nic
 
Back
Top