Good morning, hope everyone who read this is well
I am trying to do a running Total for my marketing database my company has asked me to produce
A client buys Product A, B, C the quantity is entered and a total (price*quantity) is figured. now in my form i created a text box that works out the total and displays it.
when i went to put that in a report i realised that the textbox i made couldn't be linked too (i believe?) so i made a query that will work out the running total for me.
I created a Dsum to work this out.
what iv got is
this works, however when i refine my query to just show data for one Client (e.g. Testco) the Stotal function includes the totals from the other Clients
e.g. instead of starting at 45, it starts at 105, including 60 from the previous Client.
If you follow me so far my question is, am i doing this the right way, or do i need to change my approach.
I believe its my "SalesID <=" &[MySales] which is the issue, however my minds blank as to what clause i should be using!
Thanks for any help you can give
I am trying to do a running Total for my marketing database my company has asked me to produce
A client buys Product A, B, C the quantity is entered and a total (price*quantity) is figured. now in my form i created a text box that works out the total and displays it.
when i went to put that in a report i realised that the textbox i made couldn't be linked too (i believe?) so i made a query that will work out the running total for me.
I created a Dsum to work this out.
what iv got is
Code:
STotal: Dsum("total","qrySales","SalesID <=" &[MySales])
this works, however when i refine my query to just show data for one Client (e.g. Testco) the Stotal function includes the totals from the other Clients
e.g. instead of starting at 45, it starts at 105, including 60 from the previous Client.
If you follow me so far my question is, am i doing this the right way, or do i need to change my approach.
I believe its my "SalesID <=" &[MySales] which is the issue, however my minds blank as to what clause i should be using!
Thanks for any help you can give