How to add 2 new values to a table?

H

Henro

I have a report calculating the amount of money at a certain moment in
an account. That is calculated as: last amount in account + change in
amount.

So lets say #1-1-2005# there was 115.000 in the account. #2-1-2005#
10.000 gets added. On #2-1-2005# the value should be 125.000. On
#4-1-2005# 5.000 gets aded so the new value should read 130.000


Since the the information leading to that value will at a later time not
be available in the database I want to store that value in a table along
with the date it was calculated I want to store that value in a separate
table.

Calculating the values works fine but how do I write the two values
(SettlementDate) and (AmountInAccount) to a table? Shouldn't I be using
..addnew or something?

SettlementDate AmountInAccount

#1-1-2005# 115.000
#2-1-2005# 125.000
#4-1-2005# 130.000


TIA Henro
 
R

RuralGuy

There are several ways to accomplish what you need. Here's one:
Warning <<Air Code>>
Code:
Dim MySQL As String
MySQL = "Insert Into tblRunningTotal(SettlementDate,AmountInAccount) " & _
"Values(#1-1-2005#,115.000)"
CurrentDB().Execute MySQL, dbFailOnError

I have a report calculating the amount of money at a certain moment in
an account. That is calculated as: last amount in account + change in
amount.

So lets say #1-1-2005# there was 115.000 in the account. #2-1-2005#
10.000 gets added. On #2-1-2005# the value should be 125.000. On
#4-1-2005# 5.000 gets aded so the new value should read 130.000


Since the the information leading to that value will at a later time not
be available in the database I want to store that value in a table along
with the date it was calculated I want to store that value in a separate
table.

Calculating the values works fine but how do I write the two values
(SettlementDate) and (AmountInAccount) to a table? Shouldn't I be using
.addnew or something?

SettlementDate AmountInAccount

#1-1-2005# 115.000
#2-1-2005# 125.000
#4-1-2005# 130.000


TIA Henro

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
H

Henro

Thank you!


RuralGuy schreef:
There are several ways to accomplish what you need. Here's one:
Warning <<Air Code>>
Code:
Dim MySQL As String
MySQL = "Insert Into tblRunningTotal(SettlementDate,AmountInAccount) " & _
"Values(#1-1-2005#,115.000)"
CurrentDB().Execute MySQL, dbFailOnError

I have a report calculating the amount of money at a certain moment in
an account. That is calculated as: last amount in account + change in
amount.

So lets say #1-1-2005# there was 115.000 in the account. #2-1-2005#
10.000 gets added. On #2-1-2005# the value should be 125.000. On
#4-1-2005# 5.000 gets aded so the new value should read 130.000


Since the the information leading to that value will at a later time not
be available in the database I want to store that value in a table along
with the date it was calculated I want to store that value in a separate
table.

Calculating the values works fine but how do I write the two values
(SettlementDate) and (AmountInAccount) to a table? Shouldn't I be using
.addnew or something?

SettlementDate AmountInAccount

#1-1-2005# 115.000
#2-1-2005# 125.000
#4-1-2005# 130.000


TIA Henro


_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
Top