AlexN
Registered User.
- Local time
- Today, 18:56
- Joined
- Nov 10, 2014
- Messages
- 302
In a database with the structure shown in the attached .jpg file, (for those who do open dbs I attached the database with some data), I created a runningsum query, just like the way I saw it done (or at least as I figured it out) on almost every site, blog, or video tutorial, I’ve searched (even in the ms office support):
I created a TransactionIDAlias field (TransactionID is an autonumber field and the only one with unique values), grouped the TransactionAmount field by SUM, and created the RunTot field with the DSum expression (=DSum("TransactionAmount";"tblTransactions";"[TransactionID]<=" & [TransactionIDAlias] & ""), grouped by Expression.
I had a couple of major issues though:
1. Suppose we have to enter in tblTransactions, a transaction of a previous date, we had forgotten to enter in the appropriate date. The transaction takes the latest transactionID number and appends to the end of the RunningSum query, changing the current runninsum to an unreal value. The same thing happens if the query is sorted by date. This is quite annoying and makes the runningsum value unusable for further calculations or even mere display.
2. When we enter a transaction of a different account in tblTransactions, runningsum query creates a new record with a RunTot value based on the previous one, which belongs to different account though. As you can easily understand this is everything but correct, and mostly frustrating. Same thing happens even if I filter the query by Account.
3. Supposing the RunTot field’s value is the correct one, I tried to show it, in a text box, on another form (AccountDetails) as added information. Tried the DLast expression, even a combination of DLookup-DLast, but achieved only #error? and #Name? messages.
Read everything on this forum that had to do with running sums, searching a hundred times to find anything relevant on the web, tried multiple tests to fix these issues, managed nothing at the end. I’m done with ideas and I’m starting to wonder whether I got the runningsum philosophy all wrong.
Any ideas and guidance will make me grateful for life.
Thanks
I created a TransactionIDAlias field (TransactionID is an autonumber field and the only one with unique values), grouped the TransactionAmount field by SUM, and created the RunTot field with the DSum expression (=DSum("TransactionAmount";"tblTransactions";"[TransactionID]<=" & [TransactionIDAlias] & ""), grouped by Expression.
I had a couple of major issues though:
1. Suppose we have to enter in tblTransactions, a transaction of a previous date, we had forgotten to enter in the appropriate date. The transaction takes the latest transactionID number and appends to the end of the RunningSum query, changing the current runninsum to an unreal value. The same thing happens if the query is sorted by date. This is quite annoying and makes the runningsum value unusable for further calculations or even mere display.
2. When we enter a transaction of a different account in tblTransactions, runningsum query creates a new record with a RunTot value based on the previous one, which belongs to different account though. As you can easily understand this is everything but correct, and mostly frustrating. Same thing happens even if I filter the query by Account.
3. Supposing the RunTot field’s value is the correct one, I tried to show it, in a text box, on another form (AccountDetails) as added information. Tried the DLast expression, even a combination of DLookup-DLast, but achieved only #error? and #Name? messages.
Read everything on this forum that had to do with running sums, searching a hundred times to find anything relevant on the web, tried multiple tests to fix these issues, managed nothing at the end. I’m done with ideas and I’m starting to wonder whether I got the runningsum philosophy all wrong.
Any ideas and guidance will make me grateful for life.
Thanks