The sum command (as far as I know) only works when you place in a continues
form to total values in the form.
However, I don't think sum ever worked with a dlookup inside, and further,
how would the values/parameters you supply to the sum() command change
inside that function?
If this is a continues form, then dump the dlookup, and use a "join" command
(or sub-query), and then simply use the sum() command in the footer of the
form, or perhaps use a dsum() that would return the same set of records that
the form is filtered on.