would be nice to have more details e.g. screenshots about what you are trying to do with your queries and in which editor you are working with that.
I suppose you are writing an Access VBA code whith the VBA editor to create that query.
Or are you creating that sum within the query editor without VBA? In that case i think you can create a sql syntax in your query editor and use the SUM aggretions in your Tab "DRAFT" of your query. Maybe you dont need to work with the dlookup function, because must sums are created within the aggregations already, if you activate it. But without more information its hard to help you.