How can I refresh data in a calculated field on my main form after sub form data changes?

D

d.barson

Hi,
I have created a database to store my bank transactions. On my main
form which is the default form to open when the database starts, I
have 2 subforms. One subform is for deposits and one is for
withdrawals. On the main form I have a calculated field that shows my
current balance. The problem is that after I have entered either a
deposit or withdrawal the new balance does not refresh.

The other problem is that I don't want to requery the main form
because the query behind it will always ask me for my password so that
it shows the information for the account I want to see, but this seems
to be the only way for me to refresh the balance field.

Can anyone please tell me how to refresh the data (not stored in a
table) in the balance field so that it will show the correct balance
after I enter any new information into my sub forms?

I am using Access 2007 in Windows Vista Home Premium.
 
J

Jeff Boyce

Requerying starts over, as you've found.

Have you tried adding code that calculates your "new balance" to the
AfterUpdate events of your "deposit" and "withdrawal" controls?

Have you tried using the Repaint method?

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
D

d.barson

Requerying starts over, as you've found.

Have you tried adding code that calculates your "new balance" to the
AfterUpdate events of your "deposit" and "withdrawal" controls?

Have you tried using the Repaint method?

--
Regards

Jeff Boycewww.InformationFutures.net

Microsoft Office/Access MVPhttp://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentorhttp://microsoftitacademy.com/









- Show quoted text -

Hi Jeff,

Yes I have tried the AfterUpdate method but this did not work. Never
heard of the Repaint method though. What do I need to do for Repaint?

Cheers
 
D

d.barson

.Repaint instead of .Requery

--
Regards

Jeff Boycewww.InformationFutures.net

Microsoft Office/Access MVPhttp://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentorhttp://microsoftitacademy.com/





text -





- Show quoted text -

Sorry, this did not work either.
 

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