refresh a subform and specifically a field for each record

Access 2010  subform

Is there a way to refresh a subform and based  a field in that subform so..and vba code for that field is ran ?

I have vba code thats needs to run in the after update event..

APPROVED_GP_AfterUpdate  for each record in the field itself.

Thanks
fordraiders
LVL 3
FordraidersAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You can refresh a subform like this:

From the Parent form: Me.NameOfSubformControl.Form.Refresh

From the subform: Me.Refresh

The AfterUpdate event for a Control only runs when that Control is updated. If you need to run code at other times, not in response to an Event, you should move that code to a Sub or Function, and call that Sub or Function as needed. In the control's AfterUpdate event, for example, of when you Refresh.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
hi,

if the value in the control is bound to a field that is used for row or record sources, you can force a save right after the control is updated on the control AfterUpdate event:
   Me. Dirty = false 'save record -- no need to test if on bound control AfterUpdate

Open in new window

This will not requery controls or refresh (sub)forms that might be affected.  It will, however, display updated results for calculated controls in the (sub)form itself like Sums.  

Not sure what you mean by "refresh a subform" so don't know if you have what you need to know yet. Scott gave you some good information too

have an awesome day,
crystal
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.