I am experimenting with VBA doing calculations of a filed in my database table. I have a string that is working
but the last element in the command is what is being searched for (hard coded). Instead of doing this I want to
use the value after I select from my combo box the selected value so I use the build in comvo21 like a variable.
So If I select medical from my combobox "Combo21" and I have selected from the event triger for that combobox
after update I can do MsgBox Combo21 and the selected value from the combobox will be displayed in a message box
I need to use combo21 variable in my string I can't figure out how to change my command.
How do I replace Medical with combo21 variable? Disregard the [ ] below
[Private Sub Combo21_AfterUpdate()]
[Dim stotal As Currency]
[stotal = DSum("Spending", "Spending", "Category = 'Medical'")]
[MsgBox stotal]
[End Sub