|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Writing form value back to a field in a table.
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. |
|
#2
|
|||
|
|||
|
Which field in the table is the primary key?
S- |
|
#3
|
|||
|
|||
|
Quote:
AccountNumber is the primary key which is also on a textbox on the same form which pulls values from the same underlying table. |
|
#4
|
|||
|
|||
|
UPDATE Account SET Account.PaymentDue = [Forms]![Account]![txtPaymentDue]
WHERE (((Account.AccountNumber)=[Forms]![Account]![txtAccountNumber])); S- |
|
#5
|
|||
|
|||
|
Quote:
Awesome, I got the query to work. Now is there a good place to put this query so it autoruns when either the form is loaded or changed instead of on a manual button? I think there is some setting for this, or event which I can't remember what it is. |
|
#6
|
|||
|
|||
|
I would put it in an after_updated event of one of your textboxes the this is driven off of.
S- |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Writing form value back to a field in a table. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|