J
jsccorps
I 'm running the event from a form with User and Sales inputs. I am
attempting to get the Sales from one table (SumSales) and store it in another
table (Test_App). However,the sales field is not being updated. Code is
below (bear with me - for i am a novice):
Dim rs As Recordset
Dim tmpSales As Long
Set rs = CurrentDb.OpenRecordset("Select * From [Test_SumSales] Where
[User]=" & [User], dbOpenDynaset)
With rs
tmpSales = ![SumSales] ' SumSales (265) comes from Test_SumSales
table
End With
Set rs = CurrentDb.OpenRecordset("Select * From [Test_App] Where [User]="
& [User], dbOpenDynaset)
With rs
MsgBox (tmpSales) ' value is good (= 265)
Sales = tmpSales ' set Sales (in Test_App) = SumSales value (from
the Test_SumSales table)"
MsgBox (Sales) ' value is good (= 265)
' HOWEVER, Sales is not being updated (to
265)in the Test_App table??
End With
Any ideas or more elegant solutions?
attempting to get the Sales from one table (SumSales) and store it in another
table (Test_App). However,the sales field is not being updated. Code is
below (bear with me - for i am a novice):
Dim rs As Recordset
Dim tmpSales As Long
Set rs = CurrentDb.OpenRecordset("Select * From [Test_SumSales] Where
[User]=" & [User], dbOpenDynaset)
With rs
tmpSales = ![SumSales] ' SumSales (265) comes from Test_SumSales
table
End With
Set rs = CurrentDb.OpenRecordset("Select * From [Test_App] Where [User]="
& [User], dbOpenDynaset)
With rs
MsgBox (tmpSales) ' value is good (= 265)
Sales = tmpSales ' set Sales (in Test_App) = SumSales value (from
the Test_SumSales table)"
MsgBox (Sales) ' value is good (= 265)
' HOWEVER, Sales is not being updated (to
265)in the Test_App table??
End With
Any ideas or more elegant solutions?