Topic: how to calculate bank account balance ?

Hello everyone
I am in the process of carrying out at the request of a friend, a personal account management program. Everything is fine until I stumble on the calculation of the balance (less during a debit, more during a credit).
It seems to me that Derek had made this type of calculation using a calculated field (with a debit CASE and a credit CASE), but no way to find it.
Does anyone have a solution to get the balance for each transaction ?
thanks in advance

Please find in the attachment what I need.

JB

Post's attachments

Attachment icon Exemple.jpg 52.4 kb, 33 downloads since 2023-05-10 

Re: how to calculate bank account balance ?

Hi Jean, I found a stock movement that could correspond to what you are looking for, tell me if it's good otherwise I will continue to watch on the forum.

Post's attachments

Attachment icon Calcul de stock.zip 3.81 kb, 125 downloads since 2023-05-10 

Destiny

3 (edited by Destiny 2023-05-10 13:24:55)

Re: how to calculate bank account balance ?

or this one

Post's attachments

Attachment icon Dépenses récurrentes.zip 367.31 kb, 122 downloads since 2023-05-10 

Destiny

Re: how to calculate bank account balance ?

Salut Jean,
Hope you and the family are okay.
Is this the program you were thinking about?  It should allow you to enter transactions out of sequence (for example, you forget to enter a payment so you back-date it) and the calculated field reworks all the balances.
It's been a few years since I did it but I did a quick test and I think everything is still working okay.
Hope this helps,
Derek.

Post's attachments

Attachment icon jb cash book.zip 443.41 kb, 122 downloads since 2023-05-10 

Re: how to calculate bank account balance ?

Hi Jean,
I just spotted that the format of the 'balance' column in form.tablegrid1 was incorrect - sorry about that.
Fixed in the attachment.
Derek.

Post's attachments

Attachment icon jb cash book fixed.zip 443.81 kb, 144 downloads since 2023-05-10 

Re: how to calculate bank account balance ?

Thank you Destiny
I've seen your examples before but they don't match my problem.
Derek
As usual, this is the solution. It's perfect.
For your correction, it answers a question I was asking myself:
maybe the balance formatting required a floating point and
I was about to let you know.
But your answer preceded my question.
Thank you very much again
Cordially
JB

Re: how to calculate bank account balance ?

"As usual" you said well Jean. Derek number one.

Re: how to calculate bank account balance ?

Hi Jean and Derek.
derek, i looked at the project and it is as always very functional. If you don't mind, I have a couple of questions:

1) if in Form1 you click on the congobox but don't choose anything, it still shows you the operations of the first current account, the text in the combobox is not there but if you go to add an operation it asks you to choose a value from the combobox. What could be the solution to not show the operations carried out on the first account if I don't choose anything?

2) why did you decide to make the "transaction type" combobox inactive when choosing any transaction?

Thank you!

Re: how to calculate bank account balance ?

1.
Remove the incremental search from Form1.Combobox1 and in your script, test for Form1.Combobox1 not being empty before clicking the 'search' button (see attached).
2.
The transaction values are held in 2 discrete fields depending on whether the transaction is a positive or a negative value;  this was done so the User doesn't have to indicate whether transaction values are positive or negative. If you allow the transaction type to be changed, you potentially need to be testing and clearing out the other transaction value, so it just seemed cleaner to disallow changes. 
If something has been entered incorrectly, then it can be deleted and re-entered (although there is also an argument from an audit point of view, for disallowing any deletions and that you should enter a correction transaction).
Derek.

Post's attachments

Attachment icon jb cash book fixed 2.zip 444.22 kb, 130 downloads since 2023-05-13 

10 (edited by reteinformatica 2023-05-13 20:26:00)

Re: how to calculate bank account balance ?

Hi Derek and thanks for the reply and pointers.

Re: how to calculate bank account balance ?

Hi Derek,
I noticed this thing in your project: "Transaction types" records (Form3, Tablegrid2) can be deleted. However, doing so also eliminates all transactions from the accounts.