Writing form value back to a field in a table.

E

equipe9

I have a form called Account with the following fields on it as
textboxes which pull values from an underlying table called Account.

OriginalBalance
TerminMonths
DiscountFactor

Additionally there is another textbox called PaymentDue which has the
following formula under the Control Source

=[OriginalBalance]*[DiscountFactor]/[TermInMonths]

This calculates the value of paymentdue as desired but I can not figure
out how to write the value of paymentdue back to the paymentdue field
in the Account table.

Is there an easy way to set some sort of proprty to do this?

I've tried writing an update query launched via a command button as
follows also to no avail.

UPDATE Account SET Account.PaymentDue =
[Forms]![Account]![txtPaymentDue]
WHERE (((Account.PaymentDue)=[Forms]![Account]![txtPaymentDue]));

Thanks in advance for your help.
 
A

Andrew Smith

As a general rule you should not store calculated results in a table, the
calculations should always be performed "on the fly". There may be odd times
when you might want to break this rule, generally for performance reasons,
but I don't think this is one of them.

You can use a stored query in the same way that you would use a table, so
just create a query that includes the calculation, and use that rather than
the table.
 

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

Top