Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax Error

Status
Not open for further replies.

Jackie

MIS
Feb 9, 2000
148
US
I used the following code to store data calculated in a form to a table field:<br>
<br>
Loans.[LOAN_AMOUNT] = Forms![Loans3]![LOAN_AMOUNT]<br>
<br>
An error message &quot;Variable Not Defined&quot; is displayed. The Loans table is bound to the form via the REcordSource form property. <br>
What is the proper syntax for this action?
 
First it's generally not a good practice to store results of calculations in a table if they can be calculated in real time when you need it. But I have seen times where it can't be avoided.<br>
You need to set the control source of LOAN_AMOUNT in the form to the field LOAN_AMOUNT in your table. Then to get the calculated answer to LOAN_AMOUNT, use the After Update event of your txtboxes containing the information use in the calculation to run the needed chore and to insert the result into LOAN_AMOUNT in the form. This will place the result of the calulation in the table.<br>
<br>
This is a rough sample of the After Update event:<br>
<br>
Private Sub txtYourInfo_AfterUpdate()<br>
Me![LOAN_AMOUNT] = (your calculation here)<br>
End Sub<br>
<br>
HTH<br>
RDH <p>Ricky Hicks<br><a href=mailto: rdhicks@mindspring.com> rdhicks@mindspring.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top