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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calculate field then add new record 1

Status
Not open for further replies.

ElSteveO

Programmer
Nov 6, 2001
58
0
0
US
I have a loans database where customers make monthly payments. I want to enter the payment (I know how to calculate what is interest and principal) then add the principal paid and interest paid as a new record to my transactions table. Must I use code? And if so, how do I do it?
Thanks,
ElSteveO
 
You have an unbound control so you can use a VBA embedded SQL statement run from an appropriate event:

DoCmd.RunSQL "INSERT INTO tblYourTableName (YourFieldName) VALUES (Forms!frmYourFormName!ctlYourControlName);"

Cheers, Bill




 
Dear Bill,
From my limited sql knowledge it seems like this statement inserts a value into my table from my form. However, I must insert 2 values-one for principal and one for interest. If I'm correct in my assumption how do I insert both values?
Thanks for your help
salud,
ElSteveo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top