Returning the sum of a column in a table

D

Don

I've got a text box on a form--txtEARNED. In the after update property on
another text box, I want to return the sum of the "EARNED" field in the table
"tblEMPLOYEE". An Employee may have more than one record. "tblEMPLOYEE" is
not the underlying table for my form. Can someone give me some insight on
how to build this formula? Thanks...
 
M

Marshall Barton

Don said:
I've got a text box on a form--txtEARNED. In the after update property on
another text box, I want to return the sum of the "EARNED" field in the table
"tblEMPLOYEE". An Employee may have more than one record. "tblEMPLOYEE" is
not the underlying table for my form.


Try using something like:

Me.txtEARNED = DSum("EARNED", "tblEMPLOYEE", _
"[employee ID]=" & Me.[employee ID]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top