Text box control source in a form

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

Guest

I have a text box in a form called FreightCharge with the control source set
at
=[order subtotal]*[PurchaseOrderNumber]/100. This formula works fine and
displays the data correctly in the form. I need the data displayed in this
field to be saved in the FreightCharge field of a table. I can't get this to
work. Please help. Thanks.
 
tony said:
I have a text box in a form called FreightCharge with the control source set
at
=[order subtotal]*[PurchaseOrderNumber]/100. This formula works fine and
displays the data correctly in the form. I need the data displayed in this
field to be saved in the FreightCharge field of a table. I can't get this to
work. Please help. Thanks.

Don't do it. Storing redundant data (i.e. duplicate data or data which can
be easily calcuated) is against the basic principles of good data design.
Simply use your formula to calculate the result whenever you want to display
or report it.

However, if you insist, the following statement in the form's BeforeUpdate
event should do the trick:

[FreightCharge] = [order subtotal]*[PurchaseOrderNumber]/100
 
Thanks for the help, I made the change but I get a $0.00 value instead of
$5.83.

Brian said:
tony said:
I have a text box in a form called FreightCharge with the control source set
at
=[order subtotal]*[PurchaseOrderNumber]/100. This formula works fine and
displays the data correctly in the form. I need the data displayed in this
field to be saved in the FreightCharge field of a table. I can't get this to
work. Please help. Thanks.

Don't do it. Storing redundant data (i.e. duplicate data or data which can
be easily calcuated) is against the basic principles of good data design.
Simply use your formula to calculate the result whenever you want to display
or report it.

However, if you insist, the following statement in the form's BeforeUpdate
event should do the trick:

[FreightCharge] = [order subtotal]*[PurchaseOrderNumber]/100
 
tony said:
Thanks for the help, I made the change but I get a $0.00 value instead of
$5.83.

Obviously, then, either [order subtotal] or [PurchaseOrderNumber] is zero,
but which and why I couldn't possibly say.
 
Both fields have data in them.

Brian said:
tony said:
Thanks for the help, I made the change but I get a $0.00 value instead of
$5.83.

Obviously, then, either [order subtotal] or [PurchaseOrderNumber] is zero,
but which and why I couldn't possibly say.
 
tony said:
Both fields have data in them.

So how do you explain the zero result, then? It's simple arithmetic: the
only way that formula can give a zero result is if one of the fields is
zero.
 
Brian, sorry about that my mistake. When I enter data in the two fields
order subtotal & PurchaseOrderNumber
I get no data in the FreightCharge field.
 
Back
Top