Form

M

Michelle

I am trying to have the previous balance of the previous
record to show up on the next record and so forth.

What is the formula to make it happens?

Thanks
 
T

Tony C

Try this: -

1. Create a "PublicVariables" Module and add the line: -

Public BalanceFromPreviousRec As Double,
AddPreviousBalance As Boolean

Save and close the Module.

In the following bits, I've referred to the balance
control on your form as "Balance.

Add a Text Box "PreviousBalance" to the Form, ensure that
it is an "unbound" box.
On the Forms "On Open" Procedure, add the line: -
AddPreviousBalance = False

On the Forms On Current Procedure: -

If AddPreviousBalance = True then Goto AddPrevBalance
Me.PreviousBalance=0
AddPrevBalance:
AddPreviousBalance=False
Me.PreviousBalance = BalanceFromPreviousRec
If Me.Balance <> 0 Then Exit Sub
AddPreviousBalance = True
BalanceFromPreviousRec = Me.Balance

Note

I've written this code in a bit of a hurry, so if it
doesn't work straight away reply to this post and I'll
reply tomorrow.

HTH.


Tony C.
 
M

Michelle

I will try my best to do it. Unfortunately, I am just a
beginner in the field of formulas and programming. I am
not too familiar with the terminology. I will try my best
to make it happens. In the meantime, I will maybe need
more help from you.

TIA

M
 
G

Guest

Good Afternoon,

I have tried your scenario, but it didn't worked. Because
of the error message I wasn't unable to return to my
original form, therefore I had to remove your scenario
from the module and all the procedure that you had told
me. Unfortunately, when I was able to go back to my form,
my calculation [Previous Balance]-[Grand Balance] was not
functionning anymore. I have been trying to make it work
since but hopeless. Would you have an idea how to repair
it (my calculation that does not work anymore) and would
you have a formula (not code) to enter in the field for it
to execute the function that I am looking for which was my
initial request.

Please remember that I am not a programmer and that
everything that I have learned so far is on my own. I
understand very well the logic, but unfortunately, I have
extreme difficulties understanding the programming aspect
of it.

Thank you for all your patience.

Your help is greatly appreciated.

Michelle
 

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