I have a small database, one table is called Spending, In this table I have a field called Spending and here I enter money spent on food for example.
I want to run a small VBA code from the data entry form when I enter money amount into the spending control that shows the total spending in
category called Category. Below is the code I am trying but I get an error so the syntax is wrong. I need some pointers.
If I understand my book correctly the Dsum expression is saying this!
Dsum fields Spending in table called Spending where field Category contains Groceries.
In short, how do I use this tool to pull the total money in category spending and total it up.
Private Sub Spending_AfterUpdate()
Dim stotal As Integer
stotal = DSum("Spending", "Spending", "Category = Groceries")
MsgBox stotal
End Sub
Thanks Harry Nash
MS access 2013