Hello,
I am attempting to write code that sums the values in a volume field. It is as follows:
Private Sub Command128_Click()
MsgBox DSum("Volume", "Volume")
End Sub
It works just fine, however, I want to add criteria that allows me to sum the volume of fields with a similar separate variable (codename).
In other words, instead of summing the entire "Volume" field, I want it to sum the volume of all rows with a certain codename that I input.
I attempted to write it this way:
Private Sub Command128_Click()
MsgBox DSum("Volume", "Volume", WHERE [CodeName] LIKE "*' & Me.txtVolume & '*")
End Sub
But it didn't work. txtVolume is a textbox object I added to the form object I am working in.
Any help is appreciated!