Text box control source in a form

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.
 
B

Brian

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
 
G

Guest

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
 
B

Brian

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.
 
G

Guest

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.
 
B

Brian

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top