how to calculate this function ?

Dlovan-IT

Registered User.
Local time
Tomorrow, 01:24
Joined
Oct 9, 2013
Messages
84
hell all programers

i have a table this table i used for debt the column like that

Name Price
==== ====
Jack 50$
Jack 60$
David 70$

Sum of Jack = 110$

now jack paid lets say 50$ and remain 60$ how to calculate this ?

thanks for help
 
One way would be to create a third entry for Jack with a negative 50. That way you can still sum the table.
 
thanks for your reply but i want by vba if any body can do it
 
Is it really about what you want or what the best solution is?

You should already have all the payments stored in a table so all you do is prefix it with a minus sign and run a SUM totals query.

Unless you mean that you want calculations calculated on the fly when the user enters 50 as payment. Perhaps you should properly explain what you're trying to do and where you're trying to do it.
 
You can achieve this in a number of different ways. You could perhaps extend your existing table to include a "category" (id) column so that your "price" column accommodates positive and negative values. I.e if you have a category of "deposit" and another category of "withdrawal" you can fairly easily maintain a balance.

This isn't a VBA question, it relates, pardon the pun, to your underlying table and query design.
 

Users who are viewing this thread

Back
Top Bottom